Skip to main content
deleted 2 characters in body
Source Link
Emil
  • 145
  • 8
  1. Not certain polymorphism works unless it is a pointer/reference you send inparameter, it might be the case that the base-class part of your derived class is just cut and pasted into the argument , "slicing"

  2. Watch out when the constructor parameter is some kind of reference, the compiler usually complains if one tries to create the object in place (i think it is just an rvalue then unless the parameter it is trying to bind to is const&) (personally I don't understand why, but I guess the c++ creators didn't think one would like to create something that is destroyed right after the fuction call is complete)

  1. Not certain polymorphism works unless it is a pointer/reference you send in, it might be the case that the base-class part of your derived class is just cut and pasted into the argument , "slicing"

  2. Watch out when the constructor parameter is some kind of reference, the compiler usually complains if one tries to create the object in place (i think it is just an rvalue then unless the parameter it is trying to bind to is const&)

  1. Not certain polymorphism works unless it is a pointer/reference parameter, it might be the case that the base-class part of your derived class is just cut and pasted into the argument , "slicing"

  2. Watch out when the constructor parameter is some kind of reference, the compiler usually complains if one tries to create the object in place (i think it is just an rvalue then unless the parameter it is trying to bind to is const&) (personally I don't understand why, but I guess the c++ creators didn't think one would like to create something that is destroyed right after the fuction call is complete)

added 12 characters in body
Source Link
Emil
  • 145
  • 8
  1. Not certain polymorphism works unless it is a pointer/reference you send in, it might be the case that the base-class part of your derived class is just cut and pasted into the argument , "slicing"

  2. Watch out when the constructor parameter is some kind of reference, the compiler usually complains if one tries to create the object in place (i think it is just an rvalue then unless the parameter it is trying to bind to is const&)

  1. Not certain polymorphism works unless it is a pointer you send in, it might be the case that the base-class part of your derived class is just cut and pasted into the argument

  2. Watch out when the constructor parameter is some kind of reference, the compiler usually complains if one tries to create the object in place (i think it is just an rvalue then unless the parameter it is trying to bind to is const&)

  1. Not certain polymorphism works unless it is a pointer/reference you send in, it might be the case that the base-class part of your derived class is just cut and pasted into the argument , "slicing"

  2. Watch out when the constructor parameter is some kind of reference, the compiler usually complains if one tries to create the object in place (i think it is just an rvalue then unless the parameter it is trying to bind to is const&)

Source Link
Emil
  • 145
  • 8

  1. Not certain polymorphism works unless it is a pointer you send in, it might be the case that the base-class part of your derived class is just cut and pasted into the argument

  2. Watch out when the constructor parameter is some kind of reference, the compiler usually complains if one tries to create the object in place (i think it is just an rvalue then unless the parameter it is trying to bind to is const&)