This is a simple question in fact. I have a template class with one parameter. In an other object, I make it a friend of it, like this :
template< typename type_t >
class A
{
...
}
template< typename type_t >
class B
{
template< typename >
friend class A; // Works fine !
...
}
After that, I wanted to add a condition to discard integral number when instancing the class A (and B by the way), by doing this :
template< typename type_t, std::enable_if_t< std::is_floating_point_v< type_t >, bool > = false >
class A
{
...
}
template< typename type_t, std::enable_if_t< std::is_floating_point_v< type_t >, bool > = false >
class B
{
template< typename >
friend class A; // ============> Error!
...
}
By reading the compiler message, I understood the template now has two parameters. But what should I put to the second parameter when I'm friending the class ? I tried template< typename, typename >, template< typename, bool > and template< typename, true >... All fails to compile.
What is the solution here ?