Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Stephan T. Lavavej - Core C++, 6 of n
Nov 22, 2012 at 4:28 AM@jbandela: This particular case is a bug. The direct-list-initialization form ( T v{ ... }; ) should consider explicit constructors. Note that the copy-list-initialization form
T v = { ... }; foo({ ... }) return { ... };does not.
Stephan T. Lavavej - Core C++, 6 of n
Nov 04, 2012 at 9:08 AMGreat video and great features, thanks a bunch!
I find it kinda sad that
return{some_args};aswell as
f({some_args})don't count as direct-initialization and as such can't invoke explicit constructors. Especially annoying for unique_ptr and tuple.
@Benjamin Lindley: A good example here would be the following gotcha with list-initialization:
std::vector<int> v{5};assert(v.size() == 1 && v.front() == 5);The standard explicitly demands that this happens in §13.3.1.7/1:
And a little note in §8.5.4/2:
Stephan T. Lavavej: Core C++, 3 of n
Jul 25, 2012 at 6:02 PMI think you can just use std::is_pointer() as the tag "value" for dispatching, as all UnaryTypeTraits are required to derive from either true_type or false_type (which is incidentially where the nested type typedef comes from).
Other than that, another great video, thanks.
STL11: Magic && Secrets
Feb 10, 2012 at 7:43 PM> I am definitely thinking I'll do a "Core C++" series
Yes, please!
> iostreams fills me with dread and loathing. Maintaining the stuff is just about all I can handle.
Then make it a "Bash the IOstreams" session?
Tell us what's so horrible about them!
STL11: Magic && Secrets
Feb 08, 2012 at 3:59 PM> Me too. You can think of this as "Advanced STL, Part Infinity" for the time being. :->
Heh, topic suggestion: Template meta programming! With things like Expression SFINAE, writing ones own type traits (like how to find out if a class has a certain member function), like you did in part 5 of Advanced STL.
Maybe also about constexpr? But that isn't implemented in VS, right?
Hmm, what else... I'll think about it some more and report back.
Edit: Oooh, another idea! I know this doesn't really count as STL, since they don't belong in that subpart of the library, but what about IOstreams? Especially the streambufs, locales, facets, codecvt stuff. As far as I know, there's only one real book on IOstreams, and it's from 2000 (IIRC). And personally, I think IOstreams are one of the more advanced topics, if you go beyond simple streaming to existing streams.
Variadic Templates are Funadic
Feb 07, 2012 at 12:01 AM@Andrei: But then it's still missing a "class" after the "template< >" around the Policies, or am I missing something?
Variadic Templates are Funadic
Feb 06, 2012 at 9:37 PMAt 00:19:48, I'm pretty sure there's a mistake on the slide.
template < typename T, template < template<class...> class... Policies > > class ICantBelieveItsNotButter;Either a missing "class Name" or the "template< >" around the policies is too much. So much for "My code has no mistakes".
Other than that, great talk. Enjoyed it very much. Though one thing I'd certainly like to see from the standard side is better (read: smarter) pack expansion, so we don't need to resort to recursion all that often if the expansion is actually really trivial (say, + instead of a comma):
template<class T, class Head, class... Operands> struct var_add{ static T const value = Head::value + Operands::value... // pattern -- ( ) };Whereas the recursive (and current) way would look something like this:
template<class T, class Head, class... Tail> struct var_add{ static T const value = Head::value + var_add<Tail...>::value; }; template<class T, class Head> struct var_add<T, Head>{ static T const value = Head::value; };(I hope the formatting works...)
STL11: Magic && Secrets
Feb 06, 2012 at 8:19 PMGreat talk, it's always a joy to hear you talking! I hope you'll have a little bit more time for your Advanced STL series once VS11 is out.
Then, any particular reason that nearly every slide was titled with a TVTrope?
(Also, can we get access to these slides?)