0

I have a Variant class that has string constructors. And I am trying to introduce variant type for string literals - to keep the pointer to source literal without copying it. If I remove the const char * constructor, than my new constructor is called:

Variant v = "asdf";
....

template <int size>
Variant(const char (&c_str) [size])

But I need the const char * constructor too - not all my stings are literals. And when there is such constructor, my new constructor becomes unreachable code. Can somebody explain me why? Visual Studio 2017

Simo Simov
  • 97
  • 5

0 Answers0