I got a piece of third party library to my hands in form of some non-open SDK (sorry for not providing it's name; it is not "boost"). By running cmake on it i created a set of project and solution files for Visual Studio 2012 (v11 for x86_64). When trying to comile it, the builc choked first on those block (added minimal obfuscation):
namespace sdk_name
{
namespace iterator
{
[...]
template <typename T, typename T1, typename ... R>
struct is_same_or_convertible
{
static const bool value =
is_same<T, T1>::value ||
std::is_convertible<T, T1>::value ||
is_same_or_convertible<T, R...>::value;
};
The first error appearing in the build outputs is this:
2>C:\Program Files\sdk_name\include\sdk_name/Iterator.hpp(44): error C2143: syntax error : missing ',' before '...'
The documentation tells about need for a C++11 compliant compiler that would mean at least Visual Studio 2013. Actually i have 2012 and just want to keep it for now as the tool of choice in the current project - this has various reasons.
Is there a chance to make such language objects compatible with MSVC 2012 by changing them to a functionally more or less equivalent variant? can you give me some hint what that statement is choking about, what it does mean and how the next best equivalent for my tooling could look like?
As the comments point out, VS2012 does not have variadic templates. That might be surprising, since you do have
std::tuple<...>. But have a peak at its implementation: you'll see that its implementation is not actually variadic. They just defaulted every argument, and limited the total number of arguments.This is already a bit of a hack for
std::tuple, and it might be even more work for you. Plus, it involves rewriting that third-party code. But if you absolutely, positively have to get it working on MSVC2012 and don't mind the huge effort, then that's how you work around variadic templates.