Intel C++ Compiler 16.0 beta with C++14 support
The Intel compiler is getting up to date:
Intel C++ Compiler 16.0 beta with C++14 support
From the article:
Intel® Parallel Studio XE 2016 Beta program has begun...
March 11-13, Online
March 16-18, Madrid, Spain
March 23-28, Croydon, London, UK
March 30, Kortrijk, Belgium
May 4-8, Aspen, CO, USA
May 4-8, Toronto, Canada
June 8 to 13, Brno, Czechia
June 17-20, Folkestone, UK
September 12-18, Aurora, CO, USA
November 6-8, Berlin, Germany
November 16-21, Búzios, Rio De Janeiro, Brazil
By Adrien Hamelin | Apr 14, 2015 12:14 PM | Tags: c++14
The Intel compiler is getting up to date:
Intel C++ Compiler 16.0 beta with C++14 support
From the article:
Intel® Parallel Studio XE 2016 Beta program has begun...
By Adrien Hamelin | Apr 14, 2015 11:21 AM | Tags: community c++11
In case you missed it, an interesting data point about how much programmers appreciate the improvements in C++11 (and 14) compared to C++98. As Stroustrup frequently says, C++11 feel like a new language. Note “love” means in the sense of “enjoy programming in”… more people are willing to say they enjoy programming in modern C++, and C++11 truly was a turning point and progress is continuing:
C++11 is the second "most loved" language/technology on StackOverflow according to the survey
By Adrien Hamelin | Apr 14, 2015 11:15 AM | Tags: c++11 boost
Quick A: Yes. Start with boost::irange.
Recently on SO:
Can I do something like range-for with a counting loop?
Actually this are two related questions.
I know there is new syntax in C++11 for range based for loops of the form:
//v is some container for(auto &i: v){ // do something with i }First question: how can I infer at which iteration I am in this loop? (Say I want to fill a vector with value j at position j).
Second question: I wanted to now if there also is some other way to write a loop of the form
for(int i=0; i<100; i++){ ... }I find this way of writing it a bit cumbersome and I do this so often and I would love to have a more concise syntax for it. Something along the lines:
for(i in [0..99]){ ... }would be great.
For both questions I would like to avoid having to use additional libraries.
By Adrien Hamelin | Apr 13, 2015 09:58 AM | Tags: c++11 basics
Quick A: The "= default" keeps the type trivial.
Recently on SO:
How is “=default” different from “{}” for default constructor and destructor?
I originally posted this as a question only about destructors, but now I'm adding consideration of the default constructor. Here's the original question:
If I want to give my class a destructor that is virtual, but is otherwise the same as what the compiler would generate, I can use
=default:class Widget { public: virtual ~Widget() = default; };But it seems that I can get the same effect with less typing using an empty definition:
class Widget { public: virtual ~Widget() {} };Is there any way in which these two definitions behave differently?
Based on the replies posted for this question, the situation for the default constructor seems similar. Given that there is almost no difference in meaning between "
=default" and "{}" for destructors, is there similarly almost no difference in meaning between these options for default constructors? That is, assuming I want to create a type where the objects of that type will be both created and destroyed, why would I want to sayWidget() = default;instead of
Widget() {}?
I apologize if extending this question after its original posting is violating some SO rules. Posting an almost-identical question for default constructors struck me as the less desirable option.
By Adrien Hamelin | Apr 13, 2015 09:52 AM | Tags: community boost
Come see a nice product review:
Boost.Spirit + Flatbuffers + Catch + Biicode + CLion + Github
by Max Galkin
From the article:
This weekend I’m test-driving several new technologies. OK, OK, maybe not so new for everyone else, but new for me. I’m trying to write a parser for the Flatbuffers IDL grammar using Boost.Spirit, I’m referencing Boost using Biicode, I’m testing the code using Catch, I’m editing the project in CLion, and I’m pushing the results to Github yacoder/flatbuffers-with-spirit!
By Jon Kalb | Apr 13, 2015 01:38 AM | Tags: None
Oral History of Bjarne Stroustrup
About the interview:
In a substantial interview with Paul McJones, Bjarne Stroustrup discusses his youth, his education at the Aarhus University and the University of Cambridge, and his career at AT&T Bell Laboratories, Texas A&M University, and Morgan Stanley. Also covered are his early experience with a variety of programming languages including Simula and BCPL. Finally, the interview focuses on his work on C++ and its predecessor C with Classes, including his goal of combining good abstraction mechanisms with direct access to the hardware. Specific language features discussed include value semantics, templates, concepts, the Standard Template Library, and highlights of the C++11 and C++14 standards.
By Adrien Hamelin | Apr 12, 2015 09:47 AM | Tags: performance efficiency
While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:
Pragmatic Type Erasure: Solving OOP Problems w/ Elegant Design Pattern
by Zach Laine
Summary of the talk:
There are numerous, serious OOP design problems that we have all encountered in production code. These include, among others: - object lifetime/ownership - how to make classes from different class hierarchies conform to a common interface - writing classes that can present multiple interfaces - separating interface and implementation - how to write virtual functions so that subclasses override them properly - the virtual inheritance "diamond of death"
Proper use of type erasure can mitigate, or outright eliminate, these and other problems, without sacrificing performance.
This talk will cover the OOP design problems above and more, and will cover hand-rolled and library-based type erasure approaches that solve those problems. Performance metrics will be provided for the different approaches, and source code will be available after the talk.
By Adrien Hamelin | Apr 10, 2015 08:00 AM | Tags: c++11
While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:
Embind and Emscripten: Blending C++11, JavaScript, and the Web Browser
by Chad Austin
Summary of the talk:
Emscripten compiles C or C++ source code into JavaScript so it can run in a web browser. Emscripten is commonly used to port games to the web with no download or plugin required.
Embind is a C++11 binding library that makes it easy to expose libraries written in C++ to JavaScript. This allows JavaScript applications to take advantage of existing bodies of C++ code. In addition, C++ compiled into the asm.js subset of JavaScript is often faster than hand-written JavaScript, so Embind makes it convenient to accelerate JavaScript applications by writing high-performance functionality in C++.
With several motivating examples, this lecture will cover the design of embind, how variadic templates and constexpr facilitate interesting optimizations, and how embind minimizes its impact on the size of the generated JavaScript.
By robwirving | Apr 10, 2015 05:12 AM | Tags: None
Episode 7 of CppCast the only podcast by C++ developers for C++ developers. In this episode Vittorio Romeo joins Rob Irving to talk about making simple games with C++ using libraries like SFML, SDL and Cinder.
CppCast Episode 7: Quick Game Development with Vittorio Romeo
by Rob Irving
About the interviewee:
Vittorio Romeo is an undergraduate Computer Science student at "Università degli Studi di Messina". Since childhood he has always been interested in programming, and learned to develop applications and games as an autodidact. After discovering C++ a few years ago, Vittorio became extremely passionate about its evolution and its community. He currently works on open-source general-purpose C++14 libraries and develops free open-source games. Vittorio also loves teaching: he manages a well-received C++11/C++14 video tutorial series and he talked about game development in C++ at CppCon 2014. When he's not in front of a computer, Vittorio enjoys fitness activities (weightlifting, swimming, running) and reading.
By Felix Petriconi | Apr 10, 2015 12:01 AM | Tags: None
JetBrains just released their ReSharper for C++ in version 1.0, after a year of an open beta program.
ReSharper for C++
From the website:
ReSharper C++ makes Microsoft Visual Studio a much better IDE with refactorings, navigation, code inspections, quick-fixes, code generation and more productivity features for C++ development.
ReSharper C++ extends Visual Studio with over 60 C++ code inspections that are displayed instantly, as you type.
For many of these inspections, ReSharper C++ provides quick-fixes (light bulbs) to improve code in one way or another.