473,387 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Will this initialization syntax be valid in upcoming c++0x standard ?

8
Suppose we have following two classes:
Expand|Select|Wrap|Line Numbers
  1. class Temp{
  2.  public:
  3.   char a;
  4.   char b;
  5. };
  6. class Final{
  7.  private:
  8.   int a;
  9.   char b;
  10.   char c;
  11.  public:
  12.   Final(Temp in):b(in.a),c(in.b){}
  13.   //rest of implementation
  14. };
can we initialize an object of the Final class with following syntax in upcoming c++0x standard:
Final obj(Temp{'a','b'});
Jul 16 '10 #1
1 1310
weaknessforcats
9,208 Expert Mod 8TB
This works now in VS C++.NET 2008. I can't imagine it not working ion the future.
Jul 16 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Ioannis Vranos | last post by:
I would like to see your views on these. C++98 is already a large language since it supports 4 paradigms and each one is supported well, with optimal space and time efficiency. And this is...
5
by: Ioannis Vranos | last post by:
I have initiated a similar discussion thread in clc++m, however because of the "m" in the name, the discussion is progressing slowly, so I am setting another thread here. Well the story is...
5
by: cppaddict | last post by:
Is it possible to avoid using push_back repeatedly when initializing a vector? That is, is there a vector syntax that would be analogous to the following array initialization syntax: MyClass...
10
by: utab | last post by:
Dear all, Can somebody direct me to some resources on the subject or explain the details in brief? I checked the FAQ but could not find or maybe missed. Regards,
5
by: Miguel Guedes | last post by:
Hello, Why can't non-integral static const data members be initialized within a class? I know how to initialize the members but I don't understand the underlying reason to this rule. Would...
11
by: subramanian100in | last post by:
Suppose we have a class named Test. Test obj; // assuming default ctor is available Test direct_init(obj); // direct initialization happens here Test copy_init = obj; // copy initialization...
126
by: Dann Corbit | last post by:
Rather than create a new way of doing things: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html why not just pick up ACE into the existing standard:...
10
by: Juha Nieminen | last post by:
I suppose you can never know C++ fully. I would have never guessed this actually compiles and works: struct Point { int x, y; }; struct Line { Point endpoint; int weight; };
5
by: joer3 | last post by:
When you initialize a variable like this: X var; var = X(); The equals sign is called the assignment operator and you can overload it and indeed should in many cases. However, when you...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.