python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Is it possible to use fold expression in class template deduction guide?
I did a simple test as follow:
#include <iostream>
template <typename T, std::size_t N, std::size_t D> struct MyArray {
template <typename First, typename ... Rest> MyArray(Firs...
Nima Ghorab
Votes: 0
Answers: 1
The deduction guide for std::array
In the C++ 17 and C++ 20 Working Drafts of the C++ Standard the deduction guide for the class template std::array is defined the following way
template<class T, class... U>
array(T, U...) -> ...
Vlad from Moscow
Votes: 0
Answers: 1
Type is deducted successfully when is wrapped in method, but not when used in direct alias
Code where type deduction is wrapped method
struct InterfaceOverriderFactory
{
template <typename Interface>
decltype(auto) operator()(Type<Interface>) const noexcept
{
...
Nufun
Votes: 0
Answers: 0
clang vs gcc - CTAD of struct deriving from template parameter
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 lambda */> as expected.
clang 14.x rejects it with...
Vittorio Romeo
Votes: 0
Answers: 1