C++17: Nested Namespaces--Marc Gregoire
Another new feature.
C++17: Nested Namespaces
by Marc Gregoire
From the article:
The second post in this series of C++17 features highlights a tiny but very useful new feature called nested namespaces.
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 | Aug 2, 2017 01:55 PM | Tags: c++17 basics
Another new feature.
C++17: Nested Namespaces
by Marc Gregoire
From the article:
The second post in this series of C++17 features highlights a tiny but very useful new feature called nested namespaces.
By Felix Petriconi | Aug 1, 2017 11:33 PM | Tags: intermediate
In this article "No Bugs" Hare outlines the possibility to run C++ code in the major four web browsers.
(Not Really So) New Niche for C++: Browser!?
by "No Bugs" Hare
From the article:
For quite a long while, C++ had been losing popularity; for example, as reported in [Widman16], in 2016 it got 7% less of the listings on Dice.com compared with a year earlier; and according to [TIOBE17], from the C++ Golden Age in 2004 till 2017, the C++ share fell from ~17% to a measly 6%.
As all of us (as in, ‘hardcore C++ fans’) know , this has nothing to do with the deficiencies of C++; rather it is related to an observation that the time of downloadable clients (which was one of the main C++ strongholds) has changed into the time of browser-based clients – and all the attempts to get C++ onto browsers were sooo ugly (ActiveX, anyone?) that this didn’t really leave a chance to use C++ there.
Well, it seems that this tendency is already in the process of being reverted:
C++ can already run on all four major browsers – and moreover, it has several all-important advantages over JavaScript, too.
And this – not too surprisingly – is what this article is all about.
By Adrien Hamelin | Jul 31, 2017 12:32 PM | Tags: c++17 basics
It is coming!
C++17: Structured Bindings
by Marc Gregoire
From the article:
This is a first post in a series of short articles on new C++17 features. These articles will not contain all little details of the new features being presented, but they give you an idea about what new functionality has been added to C++17.
By Adrien Hamelin | Jul 26, 2017 01:40 PM | Tags: c++17
The series continue.
C++17 in details: Code Simplification
by Bartlomiej Filipek
From the article:
You might say that most of the new language features (not to mention The Standard Library improvements) are there to write simpler/cleaner code. The “C++17 in details” series reviews most of the bigger things, still for today, I tried to pick a few features that out of the box make your code more compact.
- Structured bindings/Decomposition declarations
- Init-statement for if/switch
- Inline variables
- constexpr if (again!)
- a few other mentions
By Adrien Hamelin | Jul 26, 2017 01:23 PM | Tags: c++17 advanced
Quick A: Use is_detected
Recently on SO:
How to require an exact function signature in the detection idiom?
With C++17
is_detected, you may dotemplate <typename T, typename Ret, typename Index> using subscript_t = std::integral_constant<Ret (T::*) (Index), & T::operator[]>; template <typename T, typename Ret, typename Index> using has_subscript = is_detected<subscript_t, T, Ret, Index>; static_assert(has_subscript<std::vector<int>, int&, std::size_t>::value, "!"); static_assert(!has_subscript<std::vector<int>, int&, int>::value, "!");
By Blog Staff | Jul 26, 2017 08:37 AM | Tags: None
The ACCU 2017 keynote video is now online, with context and updates from this month's standards meeting:
Metaclasses: Thoughts on generative C++
by Herb Sutter
From the article:
I’ve been working on an experimental new C++ language feature tentatively called “metaclasses” that aims to make C++ programming both more powerful and simpler. You can find out about it here...
By Adrien Hamelin | Jul 24, 2017 01:00 PM | Tags: intermediate c++17
Do you know these new attributes?
C++17 attributes - maybe_unused, fallthrough and nodiscard
by Simon Brand
From the article:
C++17 adds three new attributes for programmers to better express their intent to the compiler and readers of the code: maybe_unused, fallthrough, and nodiscard. This is a quick post to outline what they do and why they are useful.
By Adrien Hamelin | Jul 24, 2017 12:51 PM | Tags: intermediate c++11
Quick A: To be able to know when to delete the control block.
Recently on SO:
Why shared_ptr's reference counting object needs to keep track of the number of weak_ptrs pointing to the object too?
std::weak_ptrrefers to the control block to know if the object still exists and if so, to provide astd::shared_ptrto it when needed. For that reason, the control block must exist as long as either astd::weak_ptror astd::shared_ptrexists. You need to track the number of instances ofstd::weak_ptrto know when the last one is destroyed, just like forstd::shared_ptr.
By Adrien Hamelin | Jul 21, 2017 11:03 AM | Tags: experimental efficiency
The series continue!
Yielding Generators
by Kirit Sælensminde
From the article:
We've seen how the promise_type together with the coroutine return type handles the interactions between the caller and the coroutine itself.
Our target is to be able to do something pretty simple:
generator count() { std::cout << "Going to yield 1" << std::endl; co_yield 1; std::cout << "Going to yield 2" << std::endl; co_yield 2; std::cout << "Going to yield 3" << std::endl; co_yield 3; std::cout << "count() is done" << std::endl; }
By Adrien Hamelin | Jul 20, 2017 12:49 PM | Tags: intermediate community
Quick A: Everyone by reading and applying the C++ standard.
Recently on SO:
How to (and who can) implement the standard library features defined by the C++ committee?
The committee does not release any reference implementations. In the early days, things got standardized and then the tool developers went away and implemented the standard. This has changed, and now the committee looks for features that have been implemented and tested before standardization.
Also major developments usually don't go directly into the standard. First they become experimental features called a Technical Specification or TS. These TS may then be incorporated into the main standard at a later date.
You are free to write you own implementation of the C++ standard library. Plum Hall has a test suite (commercial, I have no connection, but Plum Hall are very involved with C++ standardization).
I don't see any issue with not being conformant. Almost all implementations have some extensions. Just don't make any false claims, especially if you want to sell your product.
If you're interested in getting involved, this can be done via your 'National Body' (ANSI for the USA, BSI for the UK etc.). The isocpp web site has a section on standardization which would be a good starting place.