Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

C++0x Initialization Lists

Loading...

Sign in or sign up now!
9,733
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Oct 8, 2007

Google Tech Talks
February 21, 2007

ABSTRACT

Getting initialization right is an important part of programming. Over the years, this has led to a mess of language facilities and techniques. This talk describes how C++0x (most likely) will address two issues: how to get a uniform syntax and semantics for all initialization and how to allow initialization by general lists. Obviously, people will want the solution to be really simple and completely compatible. As ever, the resolution is to be almost completely compatible and almost simple. This talk will describe sequence constructors, homogeneous and heterogeneous initializer lists, and (as far as time allows) fit generalized constant expressions,...

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 2 dislikes

Link to this comment:

Share to:

Top Comments

  • Bjarne is my biggest fan

  • I also think he mixed up the Sick example...

see all

All Comments (15)

Sign In or Sign Up now to post a comment!
  • @tpr712 Is Bjarne Stroustrup a fan of yours?

  • cool video

  • @tpr712 Why is he your biggest fan? Whats so great about you?

  • @correaalf The explicit keyword should be placed before "Sick(double);" for the example to make sense.

  • *

    sick s = 2.1

  • @correaalf

    but this: sick = 2.1;

    prints "sick(int)"

    :)

  • I agree. I don't know exactly what is his point near 21:20. But he is wrong I tried this, and printed "sick(double)".

    struct sick{

    sick(double){std::cout<<"sick(­double)"<<std::endl;}

    explicit sick(int){std::cout<<"explicit sick(int)"<<std::endl;}

    };

    int main(){

    sick s(2.1);

    }

  • Indeed. Both gcc 4.4.0 and cl.exe (visual c++ 2009) both call the non-explicit double constructor

Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more