Skip to main content
added 3 characters in body
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

You declare the operators =operator= as returning a clr_scoped_ptr%clr_scoped_ptr%, but there's no return statement in their body. This gives me compilation errors. I supposedsuppose the implementation should be:

clr_scoped_ptr% operator=( T* ptr ) { reset(ptr); return (clr_scoped_ptr%)this; } 

template<typename U>
clr_scoped_ptr% operator=( U ptr ) { reset(ptr); return (clr_scoped_ptr%)this; }

You declare the operators = as returning a clr_scoped_ptr%, but there's no return statement in their body. This gives me compilation errors. I supposed the implementation should be:

clr_scoped_ptr% operator=( T* ptr ) { reset(ptr); return (clr_scoped_ptr%)this; } 

template<typename U>
clr_scoped_ptr% operator=( U ptr ) { reset(ptr); return (clr_scoped_ptr%)this; }

You declare the operator= as returning a clr_scoped_ptr%, but there's no return statement in their body. This gives me compilation errors. I suppose the implementation should be:

clr_scoped_ptr% operator=( T* ptr ) { reset(ptr); return (clr_scoped_ptr%)this; } 

template<typename U>
clr_scoped_ptr% operator=( U ptr ) { reset(ptr); return (clr_scoped_ptr%)this; }
Source Link
Asik
  • 341
  • 2
  • 7

You declare the operators = as returning a clr_scoped_ptr%, but there's no return statement in their body. This gives me compilation errors. I supposed the implementation should be:

clr_scoped_ptr% operator=( T* ptr ) { reset(ptr); return (clr_scoped_ptr%)this; } 

template<typename U>
clr_scoped_ptr% operator=( U ptr ) { reset(ptr); return (clr_scoped_ptr%)this; }