User forums > Using Code::Blocks

Object's function = default

(1/1)

perezprograms:
Hello everyone,

I am quite new to the forums and I am not sure how to perform the search for the subject. Hopefully, someone may edify me on this process. Please note, I am working with olcNes's header file. In it, there is a pixel class. For some reason, the pixel has an operator equal function. I understand why it would. The confusing part is this function looks like:

Pixel& operator(. . . ) = default;

What does the "= default" do? Does this tell the compiler to replace it with
Pixel& Pixel::operator=( . . . )
{
      if( this != . . . )
      {
          this = & . . . ;
       }
       return *this;
}

Or something else entirely?

Thank you for looking at this post and showing me both what = default means as well as how to search on these forums.

stahta01:
https://forums.codeblocks.org/index.php/topic,9996.0.html

Pecan:
Google "c++ operator = default" (without the quotes)

Look at second result.

perezprograms:
Thank you Pecan. That second link is quite useful. Now, I know what "= default means".

Navigation

[0] Message Index

Go to full version