c++23 Questions
2
Solved
Since the std::generator is making it into CPP23, I am playing around with MSVC's incomplete version.
However, I notice that it seems lose exactly one yield when used with std::views::take. Here is...
Aneroidograph asked 2/8, 2022 at 11:48
3
Solved
Inspired by: Why is std::aligned_storage to be deprecated in C++23 and what to use instead?
The linked proposal P1413R3 (that deprecates std::aligned_storage) says that:
Using aligned_* invokes un...
Vincentia asked 11/4, 2022 at 22:4
3
Solved
C++23 std::optional is finally getting some very useful additions.
Since my knowledge of FP is very primitive I am wondering what is the syntax for the following two operations(that according to my...
Towny asked 6/1, 2022 at 11:6
1
Solved
In the release notes for GCC12, under the section "Runtime Library (libstdc++)", it says:
Improved experimental C++23 support, including: [...] <stacktrace> (not built by default, ...
1
The C++23 draft mandates that later non-static data members of a structure or class must have higher addresses. AFAIK earlier standards require this also partitially but there are rules when the co...
Duel asked 15/5, 2022 at 18:58
1
Solved
The only options available are std::ranges::for_each and simple range-based for loop. No counterparts for std::accumulate, std::reduce or std::inner_product. std::ranges::reduce would be enough, if...
1
Solved
I just saw that C++23 plans to deprecate both std::aligned_storage and std::aligned_storage_t as well as std::aligned_union and std::aligned_union_t.
Placement new'd objects in aligned storage are ...
Cholecystectomy asked 11/4, 2022 at 12:59
1
Solved
There used to be a paragraph in the standard which stated that
the names of a namespace-scope friend functions of a class template specialization are not visible during an ordinary lookup unless e...
Carreno asked 17/2, 2022 at 10:8
1
With C++23 there will be
std::pair<T1, T1>::operator =( const pair &other ) const;
For me an assignment-operator operating on const-objects doesn't make any sense since the object can't ...
1
I am playing with C++23 std::optional additions, but I can not figure out how to elegantly access the value of object if optional is active.
I know I can use if, but that is so C++20.
I really like...
Bronwyn asked 7/2, 2022 at 21:58
2
Solved
class stacktrace_entry {
public:
string description() const;
string source_file() const;
uint_least32_t source_line() const;
/* ... */
};
struct source_location {
// source location field acc...
Carbonate asked 2/2, 2022 at 8:43
1
Solved
From https://github.com/gcc-mirror/gcc/commit/3acb929cc0beb79e6f4005eb22ee88b45e1cbc1d commit, C++ standard header <stacktrace> exists things such as std::stacktrace_entry but is not declared...
Richy asked 19/1, 2022 at 4:25
1
Solved
In one of the most respected stackoverflow answer I found an example of std::expected template class usages:
What are coroutines in C++20?
At the same time I cannot find any mentioning of this clas...
Tumefacient asked 13/7, 2021 at 19:50
0
[class.pre] p3 states:
If a class-head-name contains a nested-name-specifier, the class-specifier shall not inhabit a class scope.
If its class-name is an identifier, the class-specifier shall cor...
Ghislainegholston asked 3/1, 2022 at 8:50
1
Solved
C++23 introduced std::function's cousin std::move_only_function, just like its name, it is a move-only wrapper for move-only callable objects (demo):
#include <functional>
#include <memory...
Hammers asked 9/10, 2021 at 17:52
1
Solved
In order to improve the performance of writing data into std::string, C++23 specially introduced resize_and_overwrite() for std::string. In [string.capacity], the standard describes it as follows:
...
1
Solved
In C++23, deducing this is finally added to the standard.
Based on what I've read from the proposal, it opens up a new way of creating mixins, and possible to create recursive lambdas.
But I'm conf...
Limber asked 18/10, 2021 at 0:46
1
Solved
Some ranges adaptors such as filter_view, take_while_view and transform_view use std::optional's cousin copyable-box to store the callable object:
template<input_range V, copy_constructible...
Mensural asked 9/10, 2021 at 13:13
1
Solved
I've being reading the list of library changes proposed for C++23 and I'm quite curious about the std::out_ptr and std::inout_ptr (their _t siblings). As far as I understand they are some kind of w...
1
Solved
Reflection TS - C++ feature described here:
https://en.cppreference.com/w/cpp/keyword/reflexpr
I am looking for any information about this feature.
I have this table describing compiler support:
ht...
1
Solved
C++23 is going to introduce if consteval. Where is this going to be used and how does it differ from constexpr if?
1
Solved
I have read the latest draft where lazy_split_view is added.
But later on, I realized that split_view was renamed into lazy_split_view, and the split_view was renewed.
libstdc++ also recently imple...
Schedule asked 21/6, 2021 at 12:2
1
Solved
<spanstream> will debut in C++23 (see cppreference). According to the proposal, they are string-streams with std::span based buffers.
My questions are:
Does std::spanstream have somewhat equ...
2
Solved
From http://eel.is/c++draft/class.member.lookup#1 :
A search in a scope X for a name N from a program point P is a single search in X for N from P unless X is the scope of a class or class templat...
Descartes asked 31/5, 2021 at 19:59
1
Solved
The basic.scope#scope-3.3.1 says
both declare functions with the same parameter-type-list, equivalent ([temp.over.link]) trailing requires-clauses (if any, except as specified in [temp.friend]), a...
Sihun asked 15/3, 2021 at 9:55
© 2022 - 2024 — McMap. All rights reserved.