/* * Copyright (c) Facebook, Inc. and its affiliates. * * 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. */ // @author: Andrei Alexandrescu #pragma once #include #include #include #include #include #include namespace folly { template struct tag_t {}; template FOLLY_INLINE_VARIABLE constexpr tag_t tag{}; #if __cpp_lib_bool_constant || _MSC_VER using std::bool_constant; #else // mimic: std::bool_constant, C++17 template using bool_constant = std::integral_constant; #endif template using index_constant = std::integral_constant; namespace detail { // is_instantiation_of_v // is_instantiation_of // // A trait variable and type to check if a given type is an instantiation of a // class template. // // Note that this only works with type template parameters. It does not work // with non-type template parameters, template template parameters, or alias // templates. template