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)
Template argument deduction fails when passing enum
I'm trying to insert an enum parameter into a constexpr function. I have done this in the past and it always worked... except in this case. This case is only special in that I'm calling a factory func...
glades
Votes: 0
Answers: 0
Initialize POD with two arrays using a factory function in C++11
I need to POD-initialize a struct of multiple arrays from a factory function. How do I forward its parameters to the brace-init list that is required to create the POD-struct (C++11)? I get this error...
glades
Votes: 0
Answers: 1
How to elide type of temporary object in a variadic function call?
When is it possible to elide types of temporaries passed into a variadic function template? Overload resolution doesn't seem to work. Consider this:
#include <vector>
struct option
{
std::v...
glades
Votes: 0
Answers: 0
Constexpr expand constructor parameter pack into member array (C++11)
I want to expand a pack of variadic parameters into a struct member in C++11. My approach is the following:
template <typename... Ts>
struct cxpr_struct
{
constexpr cxpr_struct(Ts... Args) :...
glades
Votes: 0
Answers: 1