All Questions
Tagged with function-templates template-meta-programming
6 questions
0
votes
0
answers
85
views
C++ Function Parameters Guiding CTAD
I am trying to do something involving CTAD within function calls and it's best to first explain the desired behavior with an example, before asking my questions. NB: the below is a bit of a ...
1
vote
1
answer
148
views
Battling type parameter order and enable_if specifications in function templates
Consider:
template <typename InputIt, typename T = typename std::remove_const<typename InputIt::value_type>::type>
std::vector<T> WorkOnIt( InputIt first, InputIt last)
{
std::...
5
votes
1
answer
209
views
c++ address of an overloaded function
I have the following small C++ code sample, but I can't figure out why the compiler works this way, although I have spent quite a lot of time studying cppreference. I would appreciate any explanations!...
-1
votes
1
answer
70
views
most succinct or canonical way to bind class members for purposes of input, output, etc. using power of modern C++
My application requires end-users to write some classes to which I'll feed input data and take output data from. These user classes can be subclasses of a base class I provide. A way that's worked ...
2
votes
3
answers
173
views
Conditional template type math
I have a C++ function that takes in an array of uint8_t performs various functions on it that require a uint16_t and emits a smaller uint8_t array.
For a uint16_t input I might need a uint32_t array, ...
4
votes
1
answer
872
views
C++ Variadic functions with no argument
I have multiple classes (Foo and Bar here for simplicity)
struct Bar {};
struct Foo {};
and a function that takes a single template parameter and does something based on that type:
template <...