hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
common.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_COMMON_HPP
7 #define IROHA_COMMON_HPP
8 
9 #include <boost/optional.hpp>
10 #include <memory>
11 
12 namespace iroha {
13  namespace model {
14  // Optional over shared pointer
15  template <typename T>
16  using optional_ptr = boost::optional<std::shared_ptr<T>>;
17 
18  template <typename T, typename... Args>
20  return std::make_shared<T>(std::forward<Args>(args)...);
21  }
22  } // namespace model
23 } // namespace iroha
24 
25 #endif // IROHA_COMMON_HPP
Definition: block_query.hpp:15
optional_ptr< T > make_optional_ptr(Args &&... args)
Definition: common.hpp:19
boost::optional< std::shared_ptr< T > > optional_ptr
Definition: common.hpp:16