Skip to main content
7 votes
2 answers
237 views

C++26 introduces constant_wrapper which is a powerful wrapper of compile-time constant as a type system part. C++26 also introduces function_ref, which has its own constant_arg_t wrapper (was called ...
Alex Guteniev's user avatar
4 votes
1 answer
139 views

I know that you can use C++26 Reflection to define non-template aggregate types or even specific specializations of templates (demo). My Question now is: Is it also possible to define the entire ...
Velocirobtor's user avatar
3 votes
1 answer
141 views

Background info: I am trying to write a source code (i.e., plain text) generation tool which generates a stub implementation of an abstract base class. This looks something like namespace acme { ...
Lia Stratopoulos's user avatar
4 votes
3 answers
187 views

I am trying to compile the following code with GCC 15 (C++26 enabled): constexpr std::span<const int> s = {0,0}; However, the following compiler error occurs: span.cpp:7:48: error: ‘std::span&...
0x2207's user avatar
  • 1,094
4 votes
1 answer
131 views

So, this works: #include <meta> int main() { int a = 1; constexpr std::meta::info IntInfo = ^^int; [:IntInfo:] b = 42; } https://godbolt.org/z/ffjnETWzb I'd like to declare a ...
KulaGGin's user avatar
  • 1,383
17 votes
2 answers
870 views

Whereas: std::function has a single type, i.e template <typename Sig> std::function<Sig>; std::function_ref is variadic, i.e template< class...> class function_ref; (and all ...
Jarod42's user avatar
  • 230k
2 votes
2 answers
159 views

How does the concept of trivial relocatability from C++26 change how we reason about value categories? Do they interact at all (e.g., temporary-materialization rules)? For instance, if I have a ...
vinipsmaker's user avatar
  • 2,262
2 votes
2 answers
163 views

Using C++26 reflection, the following works nicely: template<size_t from, size_t to, typename F> void compile_time_index_access(size_t index, F&& f) { template for(constexpr size_t i : ...
Amir Kirsh's user avatar
  • 14.6k
Advice
1 vote
3 replies
87 views

The question has moved to be a Q&A post following the comments: C++ reflection - compile time index access - but not with a macro
Amir Kirsh's user avatar
  • 14.6k
1 vote
0 answers
108 views

I have built GCC 16.0 trunk in order to test out the new C++26 reflection capabilities. I am developing using WSL (Ubuntu) and VSCode. As it stands, I have the following basic example in a simple ...
Dnarok's user avatar
  • 21
Advice
0 votes
1 replies
54 views

i need to call a function bar from foo with pack expansion of template arguments bar needs an index, its not stateful but i need the index of the template argument #include <string> #include <...
tejas's user avatar
  • 1,973
1 vote
1 answer
164 views

I am experimenting with the new annotation freshly added in C++26, specifically looking at the examples provided in the proposal paper. The paper contains the following example using a hypothetical ...
Desmond Gold's user avatar
  • 2,310
Advice
0 votes
7 replies
134 views

C++11 value categories (lvalues, xvalues, and prvalues) are deeply entangled to the core of C++ itself in a way that's not possible to reason about C++ w/o reasoning about value semantics. C++17 ...
vinipsmaker's user avatar
  • 2,262
5 votes
3 answers
706 views

As C++26 standard's timeline is getting near, I want to know: What is(are) the reason(s) for no built in support of networking in the C++ standard. That is, what exactly are the problems that lead to ...
Richard's user avatar
  • 49.5k
15 votes
1 answer
774 views

I noticed a discrepancy between C++23 and C++26 code when using googlemock: enum A { A1, A2 }; enum B { B1, B2 }; TEST(...) { ASSERT_EQ(A1, B1); // compiles fine in C++23 and C++26 ASSERT_THAT(...
PiotrNycz's user avatar
  • 25.2k

15 30 50 per page
1
2 3 4 5 6