python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Return with aggregate initialization without type name
In C++ 20, for a type like this:
struct Person {
std::string name;
int age;
};
We can return it from a function using aggregate initialization, with or without writing out the type name:
Person g...

Zizheng Tai
Votes: 0
Answers: 1
C++ coroutine's return_void's and return_value's return type
return_void
consider the coroutine's ReturnObject below and note the comments before the method ReturnObject::promise_type::return_void :
struct ReturnObject {
struct promise_type {
...
ggulgulia
Votes: 0
Answers: 1
How can I compare system_clock::now() to a local time in c++20?
I am testing a library like follows:
std::chrono::system_clock::time_point FromDateTime(const DateTime& dateTime)
{
std::tm tm{};
tm.tm_year = dateTime.Year - 1900;
tm.tm_mon = dateTim...

Laurent Michel
Votes: 0
Answers: 1
Why does requires-expression behave differently in template and not-template for checking private member access?
In the following code class A has a private member function f. I want to write a static assertion that will check whether this function is accessible from the current context (as was suggested in the ...
Fedor
Votes: 0
Answers: 1