folly/dynamic: fix explicit specializations after instantiation
authorAndrew Gallagher <agallagher@fb.com>
Tue, 29 Jan 2013 06:54:19 +0000 (22:54 -0800)
committerJordan DeLong <jdelong@fb.com>
Mon, 4 Feb 2013 17:26:06 +0000 (09:26 -0800)
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

index 34b988e7d86fbc029536b4c023e507d5506a5feb..92cd67ef794dc011e6c2fd55c9ec4d8b0ee67494 100644 (file)
@@ -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<class T> struct dynamic::TypeInfo {
   static Type const type;
 };
 
+#define FB_DEC_TYPE(T)                                      \
+  template<> char const dynamic::TypeInfo<T>::name[];       \
+  template<> dynamic::Type const dynamic::TypeInfo<T>::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<class T>
 T dynamic::asImpl() const {
   switch (type()) {