![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Expert Programmer
|
Initializer List?
Did i really miss this? How long has this been C++ standard?
// example constructor
D3D_Engine::D3D_Engine()
{
int test1 = 0, test2 = 0;
}
//Initializer List
D3D_Engine::D3D_Engine()
: test1(0), test2(0)
{
}
__________________
"When in Rome, Do as the Romans Do" "Beauty is in the eye of the BEER holder" "Save your breath your going to need it for your blow up doll later" SearchLores.org |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
You just missed it, bub.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 915
Rep Power: 4
![]() |
Also you need to take out the "int" if you meant them to be the same. Otherwise the first one is just declaring some unused variables.
|
|
|
|
|
|
#4 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,313
Rep Power: 5
![]() |
Initialiser lists predate any C++ standard (draft or otherwise). They date back at least as far as the ARM (the Annotated Reference Manual) which was published by Ellis and Stroustrup in 1990, and was one of the base documents for C++ standardisation process.
|
|
|
|
|
|
#5 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Quote:
:p
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
|
#6 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 915
Rep Power: 4
![]() |
Thats probably why he missed the memo.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|