C++ Special Member Function Guidelines--Jonathan Müller
Short and sweet.
C++ Special Member Function Guidelines
by Jonathan Müller
From the article:
The C++ special member functions are...
September 13-19, Aurora, CO, USA
October 25, Pavia, Italy
November 6-8, Berlin, Germany
November 3-8, Kona, HI, USA
By Adrien Hamelin | Mar 4, 2019 01:13 PM | Tags: intermediate c++11
Short and sweet.
C++ Special Member Function Guidelines
by Jonathan Müller
From the article:
The C++ special member functions are...
By Adrien Hamelin | Mar 4, 2019 01:08 PM | Tags: intermediate
Quick A: it tries to convert to int.
Recently on SO:
Implicit conversion and operator overload
In comparing the conversions needed by different overloaded functions, a "promotion" is considered a better conversion sequence than a standard "conversion". Every arithmetic type can promote to at most one other type. (Promotions are also used when passing an argument to a C-style variadic function like printf. The unary + operator can be used to force a promotion of an arithmetic expression, like +n.)
For integer types which are not character types or bool, the promoted type is:
- If int can represent all the values of the original type, then int;
- Otherwise, if unsigned int can represent all the values of the original type, then unsigned int;
- Otherwise, the original type itself (promotion does nothing)
In your example, when comparing the overloaded functions, an "exact match" would be best, but there is no function taking exactly int8_t (or int8_t& or const int8_t&). The promoted type of uint8_t is int, since it's required to support a range much larger than 0-255. And apparently on your system, int32_t is an alias for int, so the function void f(int32_t); requires only a promotion on the argument. The other functions are all viable, but require an integer conversion on the argument. So void f(int32_t); is considered the best overload.
So the technical answer to the question is that it is implementation specific, but only because of the relationship between int and the <cstdint> types, not because of the overload resolution rules.
By Adrien Hamelin | Mar 4, 2019 12:54 PM | Tags: community
Did you go?
Kona: A trip report
by Corentin Jabot
From the article:
I was lucky enough to participate in a third wg21 committee meeting in a row, this time in Kona, Hawaii, a mere 13000 kilometers away...
By Meeting C++ | Mar 4, 2019 06:17 AM | Tags: meetingcpp lessons learned community basics
What can you learn, when you've wrote Tools for C++ for 20 years?
20 years of extending C++: What can we learn?
by David Millington
By Guy | Mar 4, 2019 02:48 AM | Tags: None
The committee met in Kona, Hawai'i recently; here's a trip report.
Telescopes, matrices and audio: Kona trip report
by Guy Davidson
From the article:
As we stopped and parked among the telescopes, wandering from building to building, we realised that there was probably plenty of C++ code executing behind the doors of the observatories. We are never far from our trade.
By Adrien Hamelin | Mar 1, 2019 12:30 PM | Tags: c++14 c++11
Not so old, but already an interesting history.
Lambdas: From C++11 to C++20, Part 1
by Bartlomiej Filipek
From the article:
Lambda expressions are one of the most powerful additions to C++11, and they continue to evolve with each new C++ language standard. In this article, we’ll go through history and see the evolution of this crucial part of modern C++.
By robwirving | Mar 1, 2019 10:28 AM | Tags: None
Episode 188 of CppCast the first podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Peter Bindels to talk about features approved at the ISO C++ Kona meeting for C++20 including Modules, Coroutines and much more.
CppCast Episode 188: Kona Trip Report with Peter Bindels
by Rob Irving and Jason Turner
About the interviewee:
Peter Bindels is a C++ software engineer who prides himself on writing code that is easy to use, easy to work with and well-readable to anybody familiar with the language. Since the last time he's been on CppCast he presented at multiple conferences about build tooling and simple code. In combining both, he created the build tool Evoke from cpp-dependencies and other smaller projects, leading to a simple to use build system presented at CppCon 2018. Earlier this year he presented its companion 2D Graphics library for absolute called Pixel at CppOnSea. He's active in both standards development as well as helping out with various things at conferences.
By Meeting C++ | Feb 28, 2019 07:35 AM | Tags: tmp templates meetingcpp intermediate c++17 basics
A little different angle on TMP presents Jonathan O'Connor
Alices adventures in Template Land
by Jonathan O'Connor
By Meeting C++ | Feb 26, 2019 08:57 AM | Tags: meetincpp intermediate efficiency clean code c++11 basics advanced
Arne Mertz presenting at Meeting C++:
Bringing Clean Code to large scale C++ legacy Applications
by Arne Mertz
By Adrien Hamelin | Feb 25, 2019 12:35 PM | Tags: community
ACCU’s Overload journal of February 2019 is out. It contains the following C++ related articles.
Overload 149 is now available
From the journal:
Rip It Up and Start Again.
Some things can be resurrected, others cannot. Frances Buontempo wonders when we need to repent and start over.5 Big Fat Reasons Why Mutexes Suck Big Time.
Mutable shared state in multithreaded code is often protected by mutexes. Sergey Ignatchenko reminds us that Re-Actors can avoid many of the problems.A Small Universe.
Writing a programming language is a hot topic. Deák Ferenc shows us how he wrote a compiler for bytecode callable from C++.QM Bites: Understand Windows Operating-System Identification Preprocessor Macros.
Quality matters and bite sized articles help. Matthew Wilson returns with a QM Bites.A Thorough Introduction to Distributed Systems.
What is a distributed system, and why is it so complicated? Stanislav Kozlovski explains.Don’t Use std::endl.
How do you add a new line in C++? Chris Sharpe suggests std::endl is a tiny utility that’s more trouble than it’s worth.