const member error
-
@tampere2021 sagte in const member error:
inline ABC const fn_3();
This is simply not a const function The const has to be on the right side of the function signature.
Inline is another topic and has no effect on the constness.
-
@Schlangenmensch I guess this is the right const member function. If I modify the code by removing const, then it compiles fine.
static void fn_2(const int* const) const; //original code
static void fn_2(const int* const); //modified code
-
@tampere2021 I guess below line is the final const that makes it a const member.
ABC fn_1(const int*) const
-
@tampere2021 I guess, your guess is correct.
-
@Schlangenmensch do you mean to say this line guess is correct?
ABC fn_1(const int*) const
-
class ABC { public: ABC fn_1(const int*) const; };
This is a class with a const member function which returns an object of the class itself.
-
-
@Schlangenmensch sagte in const member error:
class ABC { public: ABC fn_1(const int*) const; };
This is a class with a const member function which returns an object of the class itself.
... without modifying members of the instance.
-
@VLSI_Akiko Thanks a lot, I am clear now.
-
Dieser Beitrag wurde gelöscht!