Category "c++20"

Calling a purely template lambda callback in C++20 [duplicate]

With C++20, we've gained templated lambdas, great! []<class T>(){}; Is it possible to call a lambda callback with a template parameter,

Does header file import modules a standard thing?

C++ 20 modules guaranteed backward compatible so modules can import headers. And Visual Studio introduced header file import modules,is this stardard or just a

co_await is not supported in coroutines of type std::experimental::generator

What magic generator should I define to make the code below work? #include <experimental/generator> std::experimental::generator<int> generateInts(

How to specialize a type trait using concepts?

I am trying to use C++ concepts in order to write a type trait that will produce a different type depending on whether its template argument is a fundamental ty

Define a function signature containing a reference with C++20 Concepts

I am trying to use C++20 Concepts to constrain an interface. In this interface, I want a function signature to only use references. For some reason, I can't do

Why can I "captureless-capture" an int variable, but not a non-capturing lambda?

The following function is valid (as of C++20): void foo() { constexpr const int b { 123 }; constexpr const auto l1 = [](int a) { return b * a; }; (v

What problem do C++20 concepts really solve? [duplicate]

I'm trying to understand what problems C++20 concepts are solving and how exactly they are helpful to the end user. I understand that it helps

How to constrain class template by disabling type argument of specialization itself, and why does(n't) it work?

Is it currently possible to constrain a class template that rejects type argument which is the specialization of the class template itself without using static_

Eigen3 library with C++20 format

I am trying to print Eigen::Array or Eigen::Matrix with c++20 format, instead of Eigen::IOFormat. I would like to control the precision and alignment of element

Datetime parse and format in C++

I'm using time_point the first time. I want to parse datetime from string and found a difference when returning back to string from 1 hour. std::chrono::system_

Can std::ranges be used with std::list

I note that many algorithms can be used with ranges allowing the use of members of custom types, rather than needing lambda functions. So, am curious whether st

Question about exception guarantees for custom operator=

I have a class used to work with disk data consisting of an enum class and vector<char> sized based on the enum. The enum is an invariant for each object

Can g++ (gcc) 11 be used on Debian Bullseye?

Can g++ (gcc) 11.1 be used on Debian Bullseye? Debian 11 (bullseye) is soon to be released, and I am interested in a compiler with C++20 and modules support. De

asio How to change the executor inside an awaitable?

I have read this question and tried to replicate the answer with the following code: #include <iostream> #include <syncstream> #include <thread&g

asio How to change the executor inside an awaitable?

I have read this question and tried to replicate the answer with the following code: #include <iostream> #include <syncstream> #include <thread&g

Is there a simpler way to write a concept that accepts a set of types?

Essentially, is there a shorter/cleaner way to define Alphabet than using a bunch of std::same_as/std::is_same? struct A {}; struct B {}; struct C {}; ... temp

std::filesystem::path::u8string might not return valid UTF-8?

Consider this code, running on a Linux system (Compiler Explorer link): #include <filesystem> #include <cstdio> int main() { try {

std::future<T>::wait returns compile error in msvc

Using the msvc with the /std::c++20 flag on, I can't seem to get the wait call compiled. simple example: #include<future> std::future<int> fut = st

c++20 coroutines: boost asio co_spawn blocks from another coroutine

I do not know if this is the expected behavior of boost::asio::co_spawn (I did check the docs 1.78.0...), but if i call (e.g. co_spawn(ctx, ..., detached)) from

Performance problems with the C++20 spaceship operator?

Since C++20 the standard library uses the spaceship operator to implement comparison for strings and vectors (according to this video). I am worried that this c