CppCon 2016 teaser video
Just in time for the Early Bird registration deadline tomorrow, CppCon dropped a new teaser video. Enjoy!
See what previous years' attendees had to say, then come join the festival.
October 25, Pavia, Italy
November 6-8, Berlin, Germany
November 3-8, Kona, HI, USA
By Blog Staff | Jun 30, 2016 11:08 AM | Tags: None
Just in time for the Early Bird registration deadline tomorrow, CppCon dropped a new teaser video. Enjoy!
See what previous years' attendees had to say, then come join the festival.
By MichaelWong | Jun 30, 2016 05:52 AM | Tags: None
The good news from Oulu is that we approved the publishing of a draft of C++17.
As I changed job between the last Jacksonville and this Oulu meeting, I have been unable to keep up and write my usual update either post-meeting or pre-Oulu, so I thought I would keep it simple and make up for it in this post (although there have been plenty of other blogs) and show you all the details in a slide deck that I have been using as a keynote at recent ADC++, IWOCL 2016, the Amsterdam SG14/C++ users group meeting, and the Chicago STAC 2016 meetings.
https://wongmichael.com/2016/06/29/c17-all-final-features-from-oulu-in-a-few-slides/
If you just want to see all the features going into C++17 other than the Special Math, Parallelism, Library Fundamentals, and Filesystems TS, just go to slides 44-47 which will contain both the Language and Library features with clickable links for you to follow. The features voted in Oulu are on slide 45 for language and 47 for library.
By Adrien Hamelin | Jun 29, 2016 01:42 PM | Tags: basics
Quick A: They are not, because it is not always true.
Recently on SO:
Are `==` and `!=` mutually dependent?
You would not want the language to automatically rewrite
a != bas!(a == b)whena == breturns something other than abool. And there are a few reasons why you might make it do that.You may have expression builder objects, where
a == bdoesn't and isn't intended to perform any comparison, but simply builds some expression node representinga == b.You may have lazy evaluation, where
a == bdoesn't and isn't intended to perform any comparison directly, but instead returns some kind oflazy<bool>that can be converted to bool implicitly or explicitly at some later time to actually perform the comparison. Possibly combined with the expression builder objects to allow complete expression optimisation before evaluation.You may have some custom
optional<T>template class, where given optional variablestandu, you want to allowt == u, but make it returnoptional<bool>.There's probably more that I didn't think of. And even though in these examples the operation
a == banda != bdo both make sense, stilla != bisn't the same thing as!(a == b), so separate definitions are needed.
By Adrien Hamelin | Jun 29, 2016 01:38 PM | Tags: basics
typedef explained!
Typedef Literacy
by Michael Park
From the article:
The
typedefdeclaration provides a way to create an alias for an existing type. For example, we can provide an alias for int called integer like so:typedef int integer;I imagine most people have seen such declarations, and they are fairly simple to read. In fact it’s so simple that we may incorrectly conclude that the syntax for
typedefis:typedef <existing_type> <new_type_name>;
By Adrien Hamelin | Jun 29, 2016 01:02 PM | Tags: intermediate community
Have you registered for CppCon 2016 in September? Don’t delay – Early Bird registration is open now.
While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2015 for you to enjoy. Here is today’s feature:
Using Spirit X3 to Write Parsers
by Michael Caisse
Summary of the talk:
Parsing is a common problem in many domains. The complexity of using a library often pushes developers to ad-hoc solutions utilizing std::string manipulations, regular expressions, or nested if/switch statements. Most “quick hack” implementations are unmaintainable.
Spirit provides a Domain Specific Embedded Language (DSEL) that allows grammars to be described in a natural and declarative manner just like writing PEG or EBNF directly in your C++ code. X3 is the third major release of the Spirit library and improves both compile and run times while simplifying the much of the library.
In this tutorial session you will be introduced to Spirit X3, attribute parsing, and variety of tips to writing efficient and maintainable parsers. We will build a JSON parser during the session to illustrate techniques and usage of the library. This session is applicable toward anyone needing to parse data.
By Mark | Jun 28, 2016 11:50 PM | Tags: None
From NDC Oslo 2016:
Exploring C++17 and Beyond
by Mark Isaacson
About the video:
"[This is] a talk about playing with things that don't exist yet. The fun part, is that almost all of it is possible in C++ today. You don't need to wait. You can play with things like std::string_view and get the performance, safety/correctness, and self-documentation benefits today. You can write your own version of constexpr if that works just fine in C++11, lowering the barrier to entry for template branching and design by introspection. The one topic I talked about that you can't just try at home today is operator dot. Operator dot makes for some wonderful brain exercises. In this talk, I use it to implement contracts, specifically postconditions, in C++. In my talk from last year, I used it to let you mix in arbitrary code into any instance of any type. For anyone wondering what features are coming to C++ and when, I open the talk with a specific breakdown of what's new in C++17 and C++20. I also spend a moment talking about why things like concepts and modules didn't make it into C++17."
By Felix Petriconi | Jun 27, 2016 11:57 PM | Tags: None
Yesterday Microsoft released their update 3 of Visual Studio 2015.
Visual Studio 2015 Update 3 released
From the release note:
Several improvements for the compiler and the libraries were done. All the details can be found here.
By ibob | Jun 27, 2016 11:49 PM | Tags: None
DynaMix (Dynamic Mixins) is a new take on polymorphism. It lets the user compose and modify types at run time in C++
DynaMix released
From the release:
The library is a means to create a project's architecture rather than achieve its purpose. It focuses on maximal performance and minimal memory overhead.
DynaMix is great for the software architecture of systems with very complex objects including, but not limited to:
- Games (especially role-playing ones or strategies)
- CAD systems
- Enterprise systems
- UI libraries
By Adrien Hamelin | Jun 27, 2016 01:52 PM | Tags: intermediate efficiency
Quick A: To guarantee exception safety and for performance.
Some time ago on SO:
Why doesn't std::queue::pop return value?
So, whats the difference, pop function could have done the same thing.It could indeed have done the same thing. The reason it didn't, is because a pop that returned the popped element is unsafe in the presence of exceptions (having to return by value and thus creating a copy).
Consider this scenario (with a naive/made up pop implementation, to ilustrate my point):
template<class T> class queue { T* elements; std::size_t top_position; // stuff here T pop() { auto x = elements[top_position]; // TODO: call destructor for elements[top_position] here --top_position; // alter queue state here return x; // calls T(const T&) which may throw }If the copy constructor of T throws on return, you have already altered the state of the queue (
top_positionin my naive implementation) and the element is removed from the queue (and not returned). For all intents and purposes (no matter how you catch the exception in client code) the element at the top of the queue is lost.This implementation is also inefficient in the case when you do not need the popped value (i.e. it creates a copy of the element that nobody will use).
This can be implemented safely and efficiently, with two separate operations (
void popandconst T& front()).
By Adrien Hamelin | Jun 27, 2016 01:46 PM | Tags: intermediate community
Have you registered for CppCon 2016 in September? Don’t delay – Early Bird registration is open now.
While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2015 for you to enjoy. Here is today’s feature:
Modern User Interfaces for C++
by Milian Wolff
Summary of the talk:
The C++ language evolved significantly in the recent past, and so did many frameworks and libraries in the big ecosystem surrounding it.
For twenty years now, Qt is being used on a multitude of platforms to create native looking, compelling graphical user interfaces.
It offers C++ libraries and tools for building desktop, mobile and embedded applications. Qt gives engineers APIs for developing using two dimensional controls, integrating 3D using OpenGL, embedding web content, as well as a new declarative domain-specific language called QML, which is extensible using C++. Qt is also much more than a UI toolkit and provides a multitude of helper libraries for various use-cases, such as localization, database access, XML and JSON parsing and much more.
During this talk, I will give an introduction to Qt and present its capabilities in how it can be utilized to write modern UIs using C++, both in 2D as well as 3D. Additionally, I will show how some of its features, like the integrated web engine or QML, can be leveraged to go beyond C++. While at it, I hope to clear up some outdated misconceptions about Qt and its relationship to standard C++ and the STL as well as Boost and other libraries.
Finally, I will present the KDE Frameworks, an open source collection of high quality, cross platform Qt libraries that are being used by the KDE Software Collection. KDE frameworks are to Qt as Boost is to the STL. Recent development makes it simpler than ever to use these libraries in external applications.