From: Andrew Gallagher Date: Tue, 29 Jan 2013 06:54:19 +0000 (-0800) Subject: folly/dynamic: fix explicit specializations after instantiation X-Git-Tag: v0.22.0~1075 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=a0d036e4cd5a52b4039ca3379cd105bfe848d010;p=folly.git 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 --- 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()) {