Summary:
folly/Range.h is extensively used in fbcode, try to avoid including
<iostream> (which is pretty heavy), include forward declarations
(<iosfwd>) instead.
Also transitioned it from 'std type_traits' + 'boost type_traits' to
'std type_traits'.
Test Plan: compiled, ran tests
Reviewed By: soren@fb.com
FB internal diff:
D774834
#include "folly/Range.h"
#include <emmintrin.h> // __v16qi
#include "folly/Range.h"
#include <emmintrin.h> // __v16qi
#include "folly/Likely.h"
namespace folly {
#include "folly/Likely.h"
namespace folly {
#include <glog/logging.h>
#include <algorithm>
#include <cstring>
#include <glog/logging.h>
#include <algorithm>
#include <cstring>
#include <string>
#include <stdexcept>
#include <type_traits>
#include <boost/operators.hpp>
#include <string>
#include <stdexcept>
#include <type_traits>
#include <boost/operators.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/type_traits.hpp>
#include <bits/c++config.h>
#include "folly/CpuId.h"
#include "folly/Traits.h"
#include <bits/c++config.h>
#include "folly/CpuId.h"
#include "folly/Traits.h"
* For random-access iterators, the value before is simply i[-1].
*/
template <class Iter>
* For random-access iterators, the value before is simply i[-1].
*/
template <class Iter>
-typename boost::enable_if_c<
- boost::is_same<typename std::iterator_traits<Iter>::iterator_category,
- std::random_access_iterator_tag>::value,
+typename std::enable_if<
+ std::is_same<typename std::iterator_traits<Iter>::iterator_category,
+ std::random_access_iterator_tag>::value,
typename std::iterator_traits<Iter>::reference>::type
value_before(Iter i) {
return i[-1];
typename std::iterator_traits<Iter>::reference>::type
value_before(Iter i) {
return i[-1];
* For all other iterators, we need to use the decrement operator.
*/
template <class Iter>
* For all other iterators, we need to use the decrement operator.
*/
template <class Iter>
-typename boost::enable_if_c<
- !boost::is_same<typename std::iterator_traits<Iter>::iterator_category,
- std::random_access_iterator_tag>::value,
+typename std::enable_if<
+ !std::is_same<typename std::iterator_traits<Iter>::iterator_category,
+ std::random_access_iterator_tag>::value,
typename std::iterator_traits<Iter>::reference>::type
value_before(Iter i) {
return *--i;
typename std::iterator_traits<Iter>::reference>::type
value_before(Iter i) {
return *--i;
typedef std::size_t size_type;
typedef Iter iterator;
typedef Iter const_iterator;
typedef std::size_t size_type;
typedef Iter iterator;
typedef Iter const_iterator;
- typedef typename boost::remove_reference<
+ typedef typename std::remove_reference<
typename std::iterator_traits<Iter>::reference>::type
value_type;
typedef typename std::iterator_traits<Iter>::reference reference;
typename std::iterator_traits<Iter>::reference>::type
value_type;
typedef typename std::iterator_traits<Iter>::reference reference;
struct ComparableAsStringPiece {
enum {
value =
struct ComparableAsStringPiece {
enum {
value =
- (boost::is_convertible<A, StringPiece>::value
- && boost::is_same<B, StringPiece>::value)
+ (std::is_convertible<A, StringPiece>::value
+ && std::is_same<B, StringPiece>::value)
- (boost::is_convertible<B, StringPiece>::value
- && boost::is_same<A, StringPiece>::value)
+ (std::is_convertible<B, StringPiece>::value
+ && std::is_same<A, StringPiece>::value)
*/
template <class T, class U>
typename
*/
template <class T, class U>
typename
-boost::enable_if_c<detail::ComparableAsStringPiece<T, U>::value, bool>::type
+std::enable_if<detail::ComparableAsStringPiece<T, U>::value, bool>::type
operator==(const T& lhs, const U& rhs) {
return StringPiece(lhs) == StringPiece(rhs);
}
operator==(const T& lhs, const U& rhs) {
return StringPiece(lhs) == StringPiece(rhs);
}
*/
template <class T, class U>
typename
*/
template <class T, class U>
typename
-boost::enable_if_c<detail::ComparableAsStringPiece<T, U>::value, bool>::type
+std::enable_if<detail::ComparableAsStringPiece<T, U>::value, bool>::type
operator<(const T& lhs, const U& rhs) {
return StringPiece(lhs) < StringPiece(rhs);
}
operator<(const T& lhs, const U& rhs) {
return StringPiece(lhs) < StringPiece(rhs);
}
*/
template <class T, class U>
typename
*/
template <class T, class U>
typename
-boost::enable_if_c<detail::ComparableAsStringPiece<T, U>::value, bool>::type
+std::enable_if<detail::ComparableAsStringPiece<T, U>::value, bool>::type
operator>(const T& lhs, const U& rhs) {
return StringPiece(lhs) > StringPiece(rhs);
}
operator>(const T& lhs, const U& rhs) {
return StringPiece(lhs) > StringPiece(rhs);
}
*/
template <class T, class U>
typename
*/
template <class T, class U>
typename
-boost::enable_if_c<detail::ComparableAsStringPiece<T, U>::value, bool>::type
+std::enable_if<detail::ComparableAsStringPiece<T, U>::value, bool>::type
operator<=(const T& lhs, const U& rhs) {
return StringPiece(lhs) <= StringPiece(rhs);
}
operator<=(const T& lhs, const U& rhs) {
return StringPiece(lhs) <= StringPiece(rhs);
}
*/
template <class T, class U>
typename
*/
template <class T, class U>
typename
-boost::enable_if_c<detail::ComparableAsStringPiece<T, U>::value, bool>::type
+std::enable_if<detail::ComparableAsStringPiece<T, U>::value, bool>::type
operator>=(const T& lhs, const U& rhs) {
return StringPiece(lhs) >= StringPiece(rhs);
}
operator>=(const T& lhs, const U& rhs) {
return StringPiece(lhs) >= StringPiece(rhs);
}
#include <dlfcn.h>
#include <exception>
#include <dlfcn.h>
#include <exception>
#include <glog/logging.h>
#include "folly/experimental/exception_tracer/ExceptionAbi.h"
#include <glog/logging.h>
#include "folly/experimental/exception_tracer/ExceptionAbi.h"
#ifndef FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_EXCEPTIONTRACER_H_
#define FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_EXCEPTIONTRACER_H_
#ifndef FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_EXCEPTIONTRACER_H_
#define FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_EXCEPTIONTRACER_H_
+#include <cstdint>
+#include <iosfwd>
#include <typeinfo>
#include <vector>
#include <typeinfo>
#include <vector>
#include <stdexcept>
#include "folly/experimental/exception_tracer/ExceptionTracer.h"
#include <stdexcept>
#include "folly/experimental/exception_tracer/ExceptionTracer.h"