#ifndef TOML11_UTILITY #define TOML11_UTILITY #include "traits.hpp" #include #include namespace toml { template inline std::unique_ptr make_unique(Ts&& ... args) { return std::unique_ptr(new T(std::forward(args)...)); } namespace detail { template inline void resize_impl(T& container, std::size_t N, std::true_type) { container.resize(N); return ; } template inline void resize_impl(T& container, std::size_t N, std::false_type) { if(container.size() >= N) return; else throw std::invalid_argument("not resizable type"); } } template inline void resize(T& container, std::size_t N) { if(container.size() == N) return; else return detail::resize_impl(container, N, detail::has_resize_method()); } }// toml #endif // TOML11_UTILITY