<> - read this as a template;
I can do this:
void f() {}
//Here I'm declaring a fnc as a <> param
template<void (*fnc)()>
struct Factor { };
int main()
{
Factor<f> fac;
return 0;
}
but I cannot do this:
#include <sstream>
template<class R, class T>
R make_(T first, T second)
{
std::stringstream interpreter;
R result = R();
interpreter << first << '.' << second;
interpreter >> result;
return result;
}
//Here I'm (trying) to declare fnc <> as a <> param
template<template<class T,class R> R (*fnc)(T,T)>
struct Factor { };
int main(int argc, char* argv[])
{
Factor<make_> fac;
return 0;
}
The BIG Q is: How (if possible) can I declare as a template parameter a fnc template?
Edit
Providing that I've used Armen's advise: I would like to be able to do something like this (in main):
Factor<f<"1","02">> m;
Then in m I could make a double type out of those args ("1", "02")