I am trying to write a vector wrapper (indexed_vec) which stores objects of type ValueType but other datastructures (vectors of other types) refer to ...
I am trying to write a vector wrapper (indexed_vec) which stores objects of type ValueType but other datastructures (vectors of other types) refer to ...
I want my class object's ctor to accept a functor that is able to be converted to a std::packaged_task<R()> whereas R is auto deduced from the f ...
I have a derived class, Wrapper, that inherits from a template-defined base class. I'd like to configure Wrapper so that if the base class has constru ...
I want to make a class with a template parameter and a function (also with a template parameter) that returns a class instance. However, for shorter c ...
I have derived from std::tuple and but was unable construct the derived class from an initializer list due to issues with class template argument dedu ...
Compare the following case when I have a class object that takes a vector. The non-deduced parameter T can be substituted fine with the default templa ...
Here's something I'm trying that doesn't seem to work: I want to toggle a compile time switch based on how a class object is instantiated. If there's ...
I am reading about deduction guides in C++17. So say we have the following example: My question is that will the explicit declaration for the expli ...
This code works, without having to specify a constructor: If I make Foo a template, it doesn't work. It says deduction failed / 2 arguments were ...
Why does the following CTAD attempt fail to compile ? I would have expected that the constructor C(int) would have been deduced. ...
Consider the following code: template <typename B> struct D : B { }; D d{[]{ }}; gcc 12.x accepts it and deduces d to be D</* type of ...
I have a templated class but only part of the template arguments can be deduced from the constructor. Is there a way to provide the rest of the templ ...
In C++20, alias templates can have implicit deduction guides if it is applied. Then, I have constructed a simple template alias which is ints: templ ...
I have a lot types to use compare functors, and I would like to see if there is way to simplify it without passing the argument. Here is a dummy code ...
Little-known feature of CTAD (class template argument deduction) in C++17: you can mark user-defined deduction guides as explicit. (Godbolt.) So, c ...
I am trying to deduce a bool template argument by the choice of the class constructor. A simple example: Is this even possible or do one have to ex ...
The following program is compiled by GCC with only a warning about the redundant parentheses around the declarator. However, Clang gives a hard err ...
Let's suppose we have this template for a union of a struct and an array of bytes of the same size template<typename T> union point { struc ...
Q1 : Are user-defined deduction guides allowed at namespace scope ? In the example here, GCC and Clang does not produce the same behavior : https ...
Assume we have class that depends on two template types one of we specialize in constructor, can we not specialize deducable type? ...