On Thursday, 16 October 2014 at 05:45:00 UTC, Ola Fosheim Grøstad wrote:
On Thursday, 16 October 2014 at 03:53:53 UTC, Daniel N wrote:
There's no impact, we already support it since the template is instantiated from C++ side.

But you don't know the return type of the templated function until you know which combination of templates it instantiated?

Yes, but this is true already today for enable_if?

template<typename T>
std::enable_if_t<std::is_same<T, int>::value, float>
fun(const T& f)
{
  return f;
}

template<typename T>
std::enable_if_t<std::is_same<T, float>::value, int>
fun(const T& f)
{
  return f;
}

// Explicit Template Instantiation
template float fun(const int&);
template int   fun(const float&);

Reply via email to