Talk:C++ Programming/Classes/Member Functions

constructor is a special member function ?


 * Yes. Since its function is distinct from other member functions. --Panic (discuss • contribs) 15:48, 18 September 2011 (UTC)

There may be an issue with this statement:

Section - Named constructors

Named constructors are ... might be used for the following:
 * 1) Preventing stack allocation by making constructors private

Do you mean to prevent heap allocation? I can create a Temperature object on the stack with this:

Temperature boiling = Temperature::Celsius(100); Arbalest (discuss • contribs) 22:41, 21 February 2012 (UTC)

Too much inline methods
There is too much inline methods in examples. Method declaration in not the same in header file (*.h) and in implementation file (*.cpp):
 * do I need to let const in method implementation declaration like in prototype ?
 * same question for all keywords like virtual, ...

--89.91.69.217 (discuss) 09:00, 11 June 2013 (UTC)


 * I don't fully understand the questions, you should check inline and const keywords and how the compiler will most of the time optimize them (and even assume some default automation making the programmer use of them become simply an auto-documenting option). The virtual keyword is more specific to purpose... --Panic (discuss • contribs) 10:18, 12 June 2013 (UTC)