summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2019-12-09 11:33:08 -0500
committerNat Goodspeed <nat@lindenlab.com>2020-03-25 15:28:17 -0400
commit69fbe647abe3942ced02f14f0adc477630d9dd7e (patch)
treeed9e88b9c35912a8961928f4437bd8c71e5b69d9 /indra/llcommon
parent5e7df752a66b2082d063d2c4a10bc7013d479f55 (diff)
DRTVWR-494: VS 2013 can't yet handle variadic llmake().
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llmake.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/llcommon/llmake.h b/indra/llcommon/llmake.h
index 02463d97ea..f901ee2bf1 100644
--- a/indra/llcommon/llmake.h
+++ b/indra/llcommon/llmake.h
@@ -23,6 +23,9 @@
#if ! defined(LL_LLMAKE_H)
#define LL_LLMAKE_H
+// If we're using a compiler newer than VS 2013, use variadic llmake().
+#if (! defined(_MSC_VER)) || (_MSC_VER > 1800)
+
/**
* Usage: llmake<SomeTemplate>(args...)
*
@@ -35,6 +38,22 @@ CLASS_TEMPLATE<ARGS...> llmake(ARGS && ... args)
return CLASS_TEMPLATE<ARGS...>(std::forward<ARGS>(args)...);
}
+#else // older implementation for VS 2013
+
+template <template<typename> class CLASS_TEMPLATE, typename ARG1>
+CLASS_TEMPLATE<ARG1> llmake(const ARG1& arg1)
+{
+ return CLASS_TEMPLATE<ARG1>(arg1);
+}
+
+template <template<typename, typename> class CLASS_TEMPLATE, typename ARG1, typename ARG2>
+CLASS_TEMPLATE<ARG1, ARG2> llmake(const ARG1& arg1, const ARG2& arg2)
+{
+ return CLASS_TEMPLATE<ARG1, ARG2>(arg1, arg2);
+}
+
+#endif // VS 2013 workaround
+
/// dumb pointer template just in case that's what's wanted
template <typename T>
using dumb_pointer = T*;