More interesting topics from ACCU 2013

  • Aleksander Fabijanic talked about Dynamic C++, with reference to rival approaches to representing dynamic types: boost::any, boost::variant, boost::type_erasure, Facebook folly::dynamic and poco::dynamic::var.
  • Stig Sandres presented a way to use boost::coroutines and std::future to emulate “await” from N3564.  This follows on from N3558, which includes the ability to add “.then(…)” to a std::future.
  • I hadn’t heard of reference-qualifiers, which C++11 allows you to put on a method declaration to restrict its use to either l-value or r-value references.  See this post on Stack Overflow.  In particular, there was a proposal to restrict standard library assignment operators to l-values (since it makes no sense to assign to an r-value reference).
  • Russell Winder used std::iota from the standard <numeric> library in an example to populate a container with sequentially increasing values
std::vector<int> elements(10);
std::iota( elements.begin(), elements.end(), 0 );
std::for_each( elements.begin(), elements.end(), 
    [] (int i){ std::cout << i; }); // prints 0123456789

Leave a comment

Filed under C++

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.