Important semantic effects of small syntax errors -- Matt Wilson
Every C++ programmer should see a bug like this, from Matthew Wilson's post. As a warning.
Important semantic effects of small syntax errors
by Matt Wilson
November 14-16, Berlin, Germany
November 18-23, Wrocław, Poland
November 25, Wrocław, Poland
February 10-15, Hagenberg, Austria
March 19-21, Madrid, Spain
April 1-4, Bristol, UK
June 16-21, Sofia, Bulgaria
By Andrzej Krzemienski | May 18, 2017 07:34 AM | Tags: basics
Every C++ programmer should see a bug like this, from Matthew Wilson's post. As a warning.
Important semantic effects of small syntax errors
by Matt Wilson
By onqtam | May 17, 2017 11:31 PM | Tags: None
The fastest feature-rich C++98/C++11 single-header testing framework for unit tests and TDD
doctest 1.2 released! Focus on features and runtime performance
by Viktor Kirilov
From the release:
- improved runtime by more than 30 times compared to version 1.1.4
- templated test cases - parameterized by type
- an exception translation mechanism
- logging context with lazy stringification
- multiple binaries (dll/exe) can share the same test runner/registry
- subcases can be filtered
- the
TEST_SUITE()
macro now works with blocks of code- crash handling support - using signals under UNIX and SEH under Windows
- added test case decorators - skip, may_fail, should_fail, expected_failures, timeout, etc.
- can show duration of test case execution
- added support for un-parenthesized expressions containing commas in asserts -
CHECK(std::vector<int>{1, 2} == std::vector<int>{1, 3});
- and many more! see the complete changelog
The reddit thread might be of interest as well.
By Adrien Hamelin | May 17, 2017 08:00 AM | Tags: performance community
Have you registered for CppCon 2017 in September? Don’t delay – Registration is open now.
While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2016 for you to enjoy. Here is today’s feature:
The strange details of std::string at Facebook
by Nicholas Ormrod
Summary of the talk:
Standard strings are slowing you down. Strings are everywhere. Changing the performance of std::string has a measurable impact on the speed of real-world C++ programs. But how can you make strings better? In this talk, we'll explore how Facebook optimizes strings, especially with our open-source std::string replacement, fbstring. We'll dive into implementation tradeoffs, especially the storage of data in the struct; examine which standard rules can and cannot be flouted, such as copy-on-write semantics; and share some of the things we've learned along the way, like how hard it is to abolish the null-terminator. War stories will be provided.
By Adrien Hamelin | May 16, 2017 12:38 PM | Tags: intermediate c++11
Quick A: In C++11 it's required to be constant time.
Recently on SO:
Is list::size() really O(n)?
In C++11 it is required that for any standard container the
.size()
operation must be complete in "constant" complexity (O(1)). (Table 96 — Container requirements). Previously in C++03.size()
should have constant complexity, but is not required (see Isstd::string size()
a O(1) operation?).The change in standard is introduced by n2923: Specifying the complexity of size() (Revision 1).
By robwirving | May 16, 2017 07:15 AM | Tags: None
Episode 101 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob travels to the Microsoft Build Developer's Conference to interview Kenny Kerr from the Windows team and Marian Luparu from the Visual Studio C++ team.
CppCast Episode 101: Build 2017 with Kenny Kerr and Marian Luparu
by Rob Irving and Jason Turner
About the interviewees:
Kenny Kerr is an engineer on the Windows team at Microsoft, an MSDN Magazine contributing editor, Pluralsight author, and creator of moderncpp.com (C++/WinRT). He writes at kennykerr.ca and you can find him on Twitter at @kennykerr.
Marian Luparu is currently leading the team responsible for making Visual Studio more productive for C++ developers.
By Adrien Hamelin | May 15, 2017 08:00 AM | Tags: intermediate community
Have you registered for CppCon 2017 in September? Don’t delay – Registration is open now.
While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2016 for you to enjoy. Here is today’s feature:
Leak-Freedom in C++... By Default
by Herb Sutter
Summary of the talk:
Lifetime safety means writing code that, by construction, is guaranteed to eliminate two things: (a) use of null/dangling pointers (including pointerlike things such as references, iterators, views, and ranges), and (b) leaks (including the rare 1% case where we’re tempted to admit the possibility of an ownership cycle or need to support lock-free concurrent data structures).
Last year, my CppCon 2015 talk “Writing Good C++14… By Default” focused on (a), null/dangling, because it's the more difficult and usually more serious problem. I gave an overview of a new approach of using static analysis rules to eliminate use of null and dangling in C++. That work continues and we’re in the process of writing down the formal rules for the approach that I showed last year.
This year, the focus will be on (b), leaks: The talk aims to begin with a set of simple rules, the “5-minute talk” to demonstrate that a handful of rules can be taught broadly to programmers of all levels, and results in code that is clean and free of leak bugs by construction.
But, since we’ll still have 85 minutes left, we can use the time to spelunk through a series of “Appendix” code examples, in which we'll demonstrate "why and how" to apply those rules to a series of increasingly complex/difficult situations, and that are aimed at increasingly advanced and “clever” (note: not always a good thing) programs and programmers. We’ll address questions such as: How should we represent Pimpl types? How should we represent trees – what should the child and parent pointer types be, and (when) should they be unique and when shared? How should we deal with “intra-module” or “encapsulated” cycles when you control all the objects in the cycle, such as all the nodes within a Graph? And what about “inter-module” or “compositional” cycles when you don’t know in advance about all the objects that could be in the cycle, such as when combining libraries written by different people in a way that may or may not respect proper layering (notoriously, using callbacks can violate layering)? The answers focus on cases where we have solid guidance, and then move toward some more experimental approaches for potentially addressing the ~1% of cases that aren’t yet well covered by unique_ptr, shared_ptr, and weak_ptr.
By bfilipek | May 12, 2017 11:42 AM | Tags: performance
Can you pack 8 bools into one BYTE efficiently?
Packing Bools, Performance tests
by Bartlomiej Filipek
From the article:
The simple problem of packing seems to show a lot of performance issues. If the packing is really needed? Can we make the code parallel? What are the branching effects here?
By Adrien Hamelin | May 12, 2017 08:00 AM | Tags: None
Have you registered for CppCon 2017 in September? Don’t delay – Registration is open now.
While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2016 for you to enjoy. Here is today’s feature:
The Evolution of C++ Past, Present and Future
by Bjarne Stroustrup
Summary of the talk:
This is a philosophical talk. It deals with ideals, aims, and ways of approximating those. It deals with practical constraints and risks. It gives short examples. It presents a perspective of what drives the evolution of C++. What is C++ and what it must become over the next years for its success to continue? This involves both social and technical points. Towards the end, I discuss the direction of C++ future evolution, give some opinions, point to urgently needed new features, and discuss how to manage until they are part of the standard.
By Marco Arena | May 11, 2017 12:11 AM | Tags: visual studio
Visual Studio 2017 version 15.3 preview is now available, containing an updated Visual C++ toolset:
C++17 Features In Visual Studio 2017 Version 15.3 Preview
by Stephan T. Lavavej
From the article:
Like VS 2015’s Updates, we’re adding C++17 features in VS 2017’s Updates, at a similar release frequency...
By JoCool | May 10, 2017 11:45 PM | Tags: None
Join us to gain practical experience of writing C++ for real-time and embedded systems in Swindon, UK.
C++ for Embedded Developers
About the course:
This course is designed for:
- real-time engineers embarking on a project using C++ for the first time
- developers looking to move from C to C++ (as it will clearly demonstrate both the strengths and weaknesses of C++ vs. C)
Course overview
The course introduces the C++ language for use on real-time and embedded applications. It highlights areas of concern for real-time and embedded development. The focus is on developing core object-oriented programming skills and understanding of how to build effective, maintainable and efficient C++ programs.
Attendees perform hands-on embedded programming, on target hardware, during course practicals. Approximately 50% of the course is given over to practical work.
Course objectives
- To provide a solid understanding of the essentials of the C++ programming language.
- To give you practical experience of writing C++ for real-time and embedded systems.
- To give you the confidence to apply these new concepts to your next real-time project.
Delegates will learn
- The core C++ syntax and semantics
- How to access hardware in the language
- How to program interrupt handlers in C++
- About memory and performance issues associated with C++
- How real time operating systems (RTOS) affect the use of the language