#include <initializer_list>
struct Foo
{
template <typename T>
Foo(std::initializer_list<T>) {}
template <typename T>
Foo(std::initializer_list<typename T::BarAlias>) {}
};
struct Bar
{
using BarAlias = Bar;
};
int main()
{
Foo foo{ Bar{} };
}
I believe that a compiler should produce two exactly the same constructors inside of Foo
. Why is it even working?