An implementation is permitted to perform the initialization of an object of namespace scope with static storage duration as a static initialization even if such initialization is not required to be done statically, provided that
* the dynamic version of the initialization does not change the value of any other object of namespace scope with static storage duration prior to its initialization, and
* the static...
User Profile
Collapse
-
how to write a cast-to-reference-to-array operator for a class?
I have following class:
Code:template <size_t size> class Araye{ public: Araye(int input[]){ for (int i=0;i<size;i++) araye[i]=input[i]; } int araye[size]; };
Code:int adad[3]={1,2,3}; Araye<3>
-
Pooria started a topic does adding a dummy parameter to constructors of a class to solve calling ambiguity,in Cdoes adding a dummy parameter to constructors of a class to solve calling ambiguity,
take following class and two object definitions:
Code:class Rect{ public: enum centimeter; enum meter; Rect(double len,double wid,enum centimeter){ length=(len/100); width=(wid/100); } Rect(int len,int wid,enum meter){ length=len; width=wid; } //rest of implementation private: double length;//in meters
-
Pooria started a topic which kinds of constructors may be applied during compile time as optimization.in Cwhich kinds of constructors may be applied during compile time as optimization.
take two following classes and their constructors as samples:
Code:class One{ public: One(int a,int b):adad1(a),adad2(b){} private: int adad1; int adad2; }; class Two{ public: Two(int input[]){ for (int i=0;i<10;i++) araye[i]=input[i]; } private: int araye[10]; };
-
how does an optimizing c++ compiler reuse stack slots of a function?
How does an optimizing c++ compiler determine when a stack slot of a function(part of stack frame of a function) is no longer needed by that function, so it can reuse its memory? .
By stack slot I mean a part of stack frame of a function, not necessarily a whole stack frame of a function and an example to clarify the matter is, suppose we have a function that has six integer variables defined in its scope, when it's time to use sixth variable... -
Pooria started a topic relation between access specifiers and using initializer lists for POD types in c++0xin Crelation between access specifiers and using initializer lists for POD types in c++0x
take two following classes:
Code:class Test1{ public: Test1()=default; Test1(char in1,char in2):char1(in1),char2(in2){} char char1; char char2; }; class Test2{ public: Test2()=default; Test2(char in1,char in2):char1(in1),char2(in2){} private: char char1; char char2; };
-
Pooria started a topic a macro to extract characters of its input text and generate a code using themin Ca macro to extract characters of its input text and generate a code using them
Is there a macro that can get a text as input like "abc" and then extract characters in that text and generate a code using them, something like "{'a','b',' c'}" ?
thanks. -
Will this initialization syntax be valid in upcoming c++0x standard ?
Suppose we have following two classes:
Code:class Temp{ public: char a; char b; }; class Final{ private: int a; char b; char c; public: Final(Temp in):b(in.a),c(in.b){} //rest of implementation };
Final obj(Temp{'a','b '}...
No activity results to display
Show More
Leave a comment: