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)
How to specialize a type trait using concepts?
I am trying to use C++ concepts in order to write a type trait that will produce a different type depending on whether its template argument is a fundamental type or not:
template<typename T>
co...
Elad Maimoni
Votes: 0
Answers: 1
Concepts: require a function on a type without default constructing that type
I need to require of some type A that there exists a function f(A, A::B).
I'm testing that by calling f with instances of A and A::B. Is there a less ostentatious way to test against an instance of th...
Matt Murphy
Votes: 0
Answers: 2
Enforce class template specializations to provide one or more methods
I'm using a "traits" pattern where I have a base case expressed as a class template
template <class>
struct DoCache {
constexpr static bool value = false;
};
and I expect users to s...
Lorah Attkins
Votes: 0
Answers: 2
Defaulted concept-constrained function never selected for instantiation
While working with C++20, I encountered an oddity which I'm unsure is a compiler defect due to C++20's infancy, or whether this is correct behavior.
The problem is that a specific constrained function...
Human-Compiler
Votes: 0
Answers: 1