C++11 supports the auto keyword, but the type still has to be known at compile time.
You could also choose to make a class which specifies the cast operator from any primitive or string.
1 2 3
GenericType a = 10;
GenericType b = "im a string"; // no problem!
auto c = 10.0;
However, that's the extent to which C++ will help you. If you'd like to use a scripting language, you can support it in C++. For instance, LUA will handle weak-typing and you can integrate this very easily with C++.