portability/SysTypes.h \
portability/SysUio.h \
portability/Time.h \
+ portability/TypeTraits.h \
portability/Windows.h \
portability/Unistd.h \
Preprocessor.h \
#include <folly/detail/FunctionalExcept.h>
#endif
-#if defined(__cplusplus)
-// Unfortunately, boost::has_trivial_copy<T> is broken in libc++ due to its
-// usage of __has_trivial_copy(), so we can't use it as a
-// least-common-denominator for C++11 implementations that don't support
-// std::is_trivially_copyable<T>.
-//
-// http://stackoverflow.com/questions/12754886/has-trivial-copy-behaves-differently-in-clang-and-gcc-whos-right
-//
-// As a result, use std::is_trivially_copyable() where it exists, and fall back
-// to Boost otherwise.
-#if FOLLY_HAVE_STD__IS_TRIVIALLY_COPYABLE
-#include <type_traits>
-#define FOLLY_IS_TRIVIALLY_COPYABLE(T) \
- (std::is_trivially_copyable<T>::value)
-#else
-#include <boost/type_traits.hpp>
-#define FOLLY_IS_TRIVIALLY_COPYABLE(T) \
- (boost::has_trivial_copy<T>::value && \
- boost::has_trivial_destructor<T>::value)
-#endif
-#endif // __cplusplus
-
// MSVC specific defines
// mainly for posix compat
#ifdef _MSC_VER
#include <string.h>
#include <type_traits>
-#include <folly/detail/TurnSequencer.h>
#include <folly/Portability.h>
+#include <folly/detail/TurnSequencer.h>
+#include <folly/portability/TypeTraits.h>
#include <folly/portability/Unistd.h>
namespace folly {
--- /dev/null
+/*
+ * Copyright 2016 Facebook, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+// Unfortunately, boost::has_trivial_copy<T> is broken in libc++ due to its
+// usage of __has_trivial_copy(), so we can't use it as a
+// least-common-denominator for C++11 implementations that don't support
+// std::is_trivially_copyable<T>.
+//
+// http://stackoverflow.com/questions/12754886/has-trivial-copy-behaves-differently-in-clang-and-gcc-whos-right
+//
+// As a result, use std::is_trivially_copyable() where it exists, and fall back
+// to Boost otherwise.
+#if FOLLY_HAVE_STD__IS_TRIVIALLY_COPYABLE
+#include <type_traits>
+#define FOLLY_IS_TRIVIALLY_COPYABLE(T) (std::is_trivially_copyable<T>::value)
+#else
+#include <boost/type_traits.hpp>
+#define FOLLY_IS_TRIVIALLY_COPYABLE(T) \
+ (boost::has_trivial_copy<T>::value && boost::has_trivial_destructor<T>::value)
+#endif
#include <folly/SmallLocks.h>
#include <folly/portability/Constexpr.h>
#include <folly/portability/Malloc.h>
+#include <folly/portability/TypeTraits.h>
// Ignore shadowing warnings within this file, so includers can use -Wshadow.
#pragma GCC diagnostic push
#include <gtest/gtest.h>
#include <folly/Conv.h>
+#include <folly/portability/TypeTraits.h>
using folly::small_vector;
using namespace folly::small_vector_policy;