Код: Выделить всё
template <typename Type> std::wstring TypeInformation()
{
std::wstring Result;
Result+=L"<Terms>"; Result+=ToWString(sizeof(Type)); Result+=L"</Terms>\n";
return Result;
}
Код: Выделить всё
template <>
std::wstring TypeInformation<int>()
{
std::wstring Result;
Result+=L"<Terms>"; Result+=ToWString(sizeof(int)); Result+=L"</Terms>\n";
Result+=L"<Min>"; Result+=ToWString(std::numeric_limits<int>::min()); Result+=L"</Min>\n";
Result+=L"<Max>"; Result+=ToWString(std::numeric_limits<int>::max()); Result+=L"</Max>\n";
return Result;
}
. Если специализацию вынести в отдельный cpp-файл, тогда среда ругается на сам шаблон, говорит, чтоFunctions.hpp|218|multiple definition of `std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > TypeInformation<int>()'|
. Как с этим бороться?Functions.hpp|210|multiple definition of `std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > TypeInformation<int>()'|