From a0d036e4cd5a52b4039ca3379cd105bfe848d010 Mon Sep 17 00:00:00 2001 From: Andrew Gallagher Date: Mon, 28 Jan 2013 22:54:19 -0800 Subject: [PATCH] folly/dynamic: fix explicit specializations after instantiation Summary: clang complains that the explicit specializations in dynamic.cpp come after references in dynamic-inl.h. Test Plan: - built dyamic.o with clang - built folly normally and ran unittests Reviewed By: delong.j@fb.com FB internal diff: D691081 --- folly/dynamic-inl.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/folly/dynamic-inl.h b/folly/dynamic-inl.h index 34b988e7..92cd67ef 100644 --- a/folly/dynamic-inl.h +++ b/folly/dynamic-inl.h @@ -1,5 +1,5 @@ /* - * Copyright 2012 Facebook, Inc. + * Copyright 2013 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -691,6 +691,20 @@ template struct dynamic::TypeInfo { static Type const type; }; +#define FB_DEC_TYPE(T) \ + template<> char const dynamic::TypeInfo::name[]; \ + template<> dynamic::Type const dynamic::TypeInfo::type + +FB_DEC_TYPE(void*); +FB_DEC_TYPE(bool); +FB_DEC_TYPE(fbstring); +FB_DEC_TYPE(dynamic::Array); +FB_DEC_TYPE(double); +FB_DEC_TYPE(int64_t); +FB_DEC_TYPE(dynamic::ObjectImpl); + +#undef FB_DEC_TYPE + template T dynamic::asImpl() const { switch (type()) { -- 2.34.1