Search:

Type: Posts; User: Mr.Pointer

Search: Search took 0.01 seconds.

  1. Replies
    11
    Views
    2,384

    So temporary objects are always const, which is...

    So temporary objects are always const, which is something I didn't know. Thanks :D
  2. Replies
    11
    Views
    2,384

    Whoops, I'm really sorry, I wrote a bad example!...

    Whoops, I'm really sorry, I wrote a bad example! What I meant to write was something like this:

    Number a = 20;
    a = 40;
    The constructor is indeed called twice, and your explanation makes a lot of...
  3. Replies
    11
    Views
    2,384

    Like I said, this happens when I remove the copy...

    Like I said, this happens when I remove the copy assignment operator, and when the class doesn't have an assignment operator for an int, it calls the constructor.
  4. Replies
    11
    Views
    2,384

    Questions about constructors and operators

    I decided to start an extremely simple experiment to revise on things I already know, but came across two things that puzzled me. I have a class named Number, which only holds an integer named...
Results 1 to 4 of 4