#include <iostream>
template <std::size_t SIZE> class A
{
char b[SIZE];
public:
using const_buffer_t = const char (&)[SIZE];
using my_type = A<SIZE>;
A() : b{} { std::cout << "size: " << SIZE << " ctor 1\n"; }
A(const_buffer_t) : b{} { std::cout << "size: " << SIZE << " ctor 2\n"; }
A(const char * const) : b{} { std::cout << "size: " << SIZE << " ctor 3\n"; }
explicit A(const my_type &) : b{} { std::cout << "size: " << SIZE << " ctor 4\n"; }
template <std::size_t OTHER_SIZE>
A(const char (&)[OTHER_SIZE]) : b{} { std::cout << "size: " << SIZE << " ctor 5\n"; }
template <std::size_t OTHER_SIZE>
explicit A(const A<OTHER_SIZE> &) : b{} { std::cout << "size: " << SIZE << " ctor 6\n"; }
};
int main()
{
//A<5> a("five");
A<5> b("0123456789");
//A<9> c(a);
A<5> d;
A<5> e(d);
A<9> f(d);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdGVtcGxhdGUgPHN0ZDo6c2l6ZV90IFNJWkU+IGNsYXNzIEEKewoJY2hhciBiW1NJWkVdOwoKcHVibGljOgoJdXNpbmcgY29uc3RfYnVmZmVyX3QgPSBjb25zdCBjaGFyICgmKVtTSVpFXTsKCXVzaW5nIG15X3R5cGUgPSBBPFNJWkU+OwoJCglBKCkJCQkJCQkJOiBie30geyBzdGQ6OmNvdXQgPDwgInNpemU6ICIgPDwgU0laRSA8PCAiIGN0b3IgMVxuIjsgfQoJQShjb25zdF9idWZmZXJfdCkJCQk6IGJ7fSB7IHN0ZDo6Y291dCA8PCAic2l6ZTogIiA8PCBTSVpFIDw8ICIgY3RvciAyXG4iOyB9CglBKGNvbnN0IGNoYXIgKiBjb25zdCkJCTogYnt9IHsgc3RkOjpjb3V0IDw8ICJzaXplOiAiIDw8IFNJWkUgPDwgIiBjdG9yIDNcbiI7IH0KCWV4cGxpY2l0IEEoY29uc3QgbXlfdHlwZSAmKQk6IGJ7fSB7IHN0ZDo6Y291dCA8PCAic2l6ZTogIiA8PCBTSVpFIDw8ICIgY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