![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Aug 2005
Posts: 137
Rep Power: 4
![]() |
Implicit class converions
Hi,
My teacher recently showed the class an example where an a simple addition operator was overloaded for a class. He then went on to show a line where the integer 1 was added to the object. He said the 1 was implicitly converted to an object of the class because a constructor was defined for the class that takes one int as an argument. My question is what rules govern implicit typecasts to user defined classes. |
|
|
|
|
|
#2 | |
|
Professional Programmer
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power: 4
![]() |
Quote:
__________________
PFO - My daily dose of technology. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|