User Profile

Collapse

Profile Sidebar

Collapse
Pooria
Pooria
Last Activity: Aug 3 '10, 07:13 PM
Joined: Jul 16 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • 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...
    See more | Go to post

    Leave a comment:


  • 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];
        };
    How should I write a cast-to-reference-to-array operator for this class so that following works:

    Code:
        int adad[3]={1,2,3};
        Araye<3>
    ...
    See more | Go to post

  • does 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
    ...
    See more | Go to post

  • which 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];
    };
    considering objects with static...
    See more | Go to post

  • 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...
    See more | Go to post

  • relation 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;
    };
    I know in c++0x both of these classes...
    See more | Go to post

  • a 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.
    See more | Go to post

  • 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
    };
    can we initialize an object of the Final class with following syntax in upcoming c++0x standard:
    Final obj(Temp{'a','b '}...
    See more | Go to post
No activity results to display
Show More
Working...