Search Result

Collapse
4 results in 0.0039 seconds.
Keywords
Members
Tags
initialization
  •  

  • 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

  • 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

  • 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
Working...