#include <iostream>
#include <cstdint>

template<int T> void foo()
{
  std::cout << "a" << std::endl;
}

template<uint8_t T> void foo()
{
  std::cout << "b" << std::endl;
}

int main()
{
  foo<static_cast<uint8_t>(42)> ();
  foo<static_cast<int>(42)>();
  return(0);
}

any idea why this isn't working as expected ?

My gcc 4.8.1 is complaining about an ambiguous call, but the static_cast isn't supposed to "fix" the precedence rule in cases like this one where you have 2 types with the same precedence ?

Edit
Report