// Copyright (c) 2019 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef MP_UTIL_H #define MP_UTIL_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace mp { //! Generic utility functions used by capnp code. //! Type holding a list of types. //! //! Example: //! TypeList template struct TypeList { static constexpr size_t size = sizeof...(Types); }; //! Construct a template class value by deducing template arguments from the //! types of constructor arguments, so they don't need to be specified manually. //! //! Uses of this can go away with class template deduction in C++17 //! (https://en.cppreference.com/w/cpp/language/class_template_argument_deduction) //! //! Example: //! Make(5, true) // Constructs std::pair(5, true); template