X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FDynamicConverter.h;h=8d61048debb2c40f368cc4468fadce0a2e0bdf39;hb=321542683a01c3f334047531e9b487f047129775;hp=2f56784beec5ffed6c5224fd45fd76fc111689b8;hpb=8cbc14de44a626f616d9000b359c800213f0ae85;p=folly.git diff --git a/folly/DynamicConverter.h b/folly/DynamicConverter.h index 2f56784b..8d61048d 100644 --- a/folly/DynamicConverter.h +++ b/folly/DynamicConverter.h @@ -1,5 +1,5 @@ /* - * Copyright 2014 Facebook, Inc. + * 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. @@ -54,13 +54,20 @@ BOOST_MPL_HAS_XXX_TRAIT_DEF(value_type); BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator); BOOST_MPL_HAS_XXX_TRAIT_DEF(mapped_type); -template struct class_is_container { - typedef std::reverse_iterator some_iterator; +template struct iterator_class_is_container { + typedef std::reverse_iterator some_iterator; enum { value = has_value_type::value && - has_iterator::value && std::is_constructible::value }; }; +template +using class_is_container = typename + std::conditional< + has_iterator::value, + iterator_class_is_container, + std::false_type + >::type; + template struct class_is_range { enum { value = has_value_type::value && has_iterator::value }; @@ -108,8 +115,8 @@ namespace dynamicconverter_detail { template struct Dereferencer { - static inline void - derefToCache(T* mem, const dynamic::const_item_iterator& it) { + static inline void derefToCache( + T* /* mem */, const dynamic::const_item_iterator& /* it */) { throw TypeError("array", dynamic::Type::OBJECT); }