Can you use keyword explicit to prevent automatic conversion of method parameters?
No, you can’t use explicit, but you can use a templated function to catch the incorrect parameter types. With C++11, you can declare the templated function as deleted. Here is a simple example: #include <iostream> struct Thing { void Foo(int value) { std::cout << “Foo: value” << std::endl; } template <typename T> void Foo(T value) … Read more