Quick Q: std::bind overload resolution
Quick A: the type of the function must be explicit.
Recently on SO:
std::bind overload resolution
You need a cast to disambiguate the overloaded function:
(int(A::*)(int,int))&A::operator()
October 25, Pavia, Italy
November 6-8, Berlin, Germany
November 3-8, Kona, HI, USA
By Adrien Hamelin | Jun 18, 2018 12:07 PM | Tags: advanced
Quick A: the type of the function must be explicit.
Recently on SO:
std::bind overload resolution
You need a cast to disambiguate the overloaded function:
(int(A::*)(int,int))&A::operator()
By Adrien Hamelin | Jun 18, 2018 12:06 PM | Tags: intermediate
Quick A: Only your own type can be accessed.
Recently on SO:
Accessing protected members in a derived class
You can only access protected members in instances of your type (or derived from your type).
You cannot access protected members of an instance of a parent or cousin type.In your case, the Derived class can only access the b member of a Derived instance, not of a different Base instance.
Changing the constructor to take a Derived instance will also solve the problem.
By Adrien Hamelin | Jun 13, 2018 12:40 PM | Tags: community
MAny things happened!
ISO C++ Committee – Rapperswil 2018 trip report
by Timur Doumler
From the article:
From the 4th to the 9th of June 2018, Phil Nash and I attended the ISO C++ Committee meeting in beautiful Rapperswil, Switzerland, representing JetBrains. We are continuing our active involvement in developing and standardising C++ (please read the last trip report for details)...
By Adrien Hamelin | Jun 13, 2018 12:39 PM | Tags: community
THe second part.
Triple trip report from ACCU, C++ Russia and C++Now 2018 – Part 2
by Jonathan Boccara
From the article:
This is my second part of the combined trip report for 3 conferences: ACCU, C++ Russia and C++Now, for their 2018 editions that I had the chance to attend...
By Adrien Hamelin | Jun 12, 2018 12:36 PM | Tags: community
ACCU’s Overload journal of June 2018 is out. It contains the following C++ related articles.
Overload 145 is now available
From the journal:
Automate all the things
Automation can speed things up. Frances Buontempo considers how it can make things worse. by Frances Buontempo
How to Write a Programming Language: Part 1, The Lexer
Writing a programming language might sound very difficult. Andy Balaam starts his series with a lexer. by Andy Balaam
Type-agnostic Tracing Using {fmt}
Tracing compound and custom types is a challenge. Mike Crowe demonstrates how {fmt} provides a safe alternative to printf. by Mike Crowe
A Short Overview of Object Oriented Software Design
Object oriented design has many principles. Stanislav Kozlovski demonstrates good design through a role playing game. by Stanislav Kozlovski
By Adrien Hamelin | Jun 12, 2018 12:31 PM | Tags: c++17 basics
Spreading the knowledge.
Modern C++ Features – std::optional
by Arne Mertz
From the article:
Sometimes we want to express the state of “nothing meaningful” instead of a value. This is the use case for C++17’s std::optional...
By Adrien Hamelin | Jun 8, 2018 12:32 PM | Tags: community
Were you there?
Triple trip report from ACCU, C++ Russia and C++Now 2018 – Part 1
by Jonathan Boccara
From the article:
Going to conferences is a great experience, to learn about your domain and meet people that work in it. Going to conferences can give you tools to write better code.
I’ve had the chance to go to (and speak at) three conferences over a month:
- ACCU in Bristol, UK at the beginning of April,
- C++ Russia in Saint-Petersburg, Russia in mid April,
- C++Now in Aspen, US at the beginning of May.
I haven’t seen many people attending all three of them, so I figured I could make a combined trip report, to give you an idea of what they’re like. And more importantly what you would get by attending either one.
And a huge thanks to the company I work for, Murex, for sending me all over the world of C++!
By Adrien Hamelin | Jun 8, 2018 12:28 PM | Tags: c++17 basics
Simple and useful.
C++17: std::string_view
by Marc Gregoire
From the article:
If you have to write a function that accepts a string, what type of parameter will you use?
By Adrien Hamelin | Jun 6, 2018 12:06 PM | Tags: c++17 advanced
Really everything!
Everything You Need to Know About std::variant from C++17
by Bartlomiej Filipek
From the article:
Around the time C++17 was being standardized I saw magical terms like “discriminated union”, “type-safe union” or “sum type” floating around. Later it appeared to mean the same type: “variant”...
By Adrien Hamelin | Jun 6, 2018 11:43 AM | Tags: c++17 basics
Simple and useful.
C++17: Fallthrough in switch statements
by Marc Gregoire
From the article:
A C++ switch statement allows execution to fall through from one case to the next case when a break statement is missing...