/* * 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 #include #include #include #include namespace folly { namespace array_detail { template struct is_ref_wrapper : std::false_type {}; template struct is_ref_wrapper> : std::true_type {}; template using not_ref_wrapper = folly::Negation::type>>; template struct return_type_helper { using type = D; }; template struct return_type_helper { static_assert( folly::Conjunction...>::value, "TList cannot contain reference_wrappers when D is void"); using type = typename std::common_type::type; }; template using return_type = std:: array::type, sizeof...(TList)>; } // !array_detail template constexpr array_detail::return_type make_array(TList&&... t) { using value_type = typename array_detail::return_type_helper::type; return {static_cast(std::forward(t))...}; } } // !folly