[string_cvt] help with VC 7.1 is needed

Hello, during my work on string_cvt proposal I've faced a problem with MSVC 7.1 compiler on WinXP machine. The following code does not compile: #include <iostream> #include <string> #include <locale> #include <iomanip> template <typename T, typename TCont, typename TManip, typename TDef> inline T foo(TCont const& src, TManip const& manip_, std::locale const& loc, TDef const& def) { return T(); } int main() { int k = foo<int>(std::string("123"), std::hex, std::locale(), 1); return 0; } Note that it compiles perfectly with Comeau online. Can someone elaborate on it please? Best, Oleg Abrosimov.

On Sat, 05 Aug 2006 17:29:13 +0700, Oleg Abrosimov <beholder@gorodok.net> wrote:
Hello, during my work on string_cvt proposal I've faced a problem with MSVC 7.1 compiler on WinXP machine. The following code does not compile:
[...]
template <typename T, typename TCont, typename TManip, typename TDef> inline T foo(TCont const& src, TManip const& manip_, std::locale const& loc, TDef const& def) { return T(); }
int main() { int k = foo<int>(std::string("123"), std::hex, std::locale(), 1); return 0; }
Did you try writing "&std::hex"? -- [ Gennaro Prota, C++ developer for hire ]

Gennaro Prota ?????:
On Sat, 05 Aug 2006 17:29:13 +0700, Oleg Abrosimov <beholder@gorodok.net> wrote:
Hello, during my work on string_cvt proposal I've faced a problem with MSVC 7.1 compiler on WinXP machine. The following code does not compile:
[...]
template <typename T, typename TCont, typename TManip, typename TDef> inline T foo(TCont const& src, TManip const& manip_, std::locale const& loc, TDef const& def) { return T(); }
int main() { int k = foo<int>(std::string("123"), std::hex, std::locale(), 1); return 0; }
Did you try writing "&std::hex"?
it works, thanks! but this works as well int i = foo(std::string("a"), std::hex, std::locale()); with definition of foo without last parameter I'll add this issue to string_cvt FAQ Best, Oleg Abrosimov
participants (2)
-
Gennaro Prota
-
Oleg Abrosimov