// Copyright 2004-present Facebook. All Rights Reserved. #pragma once #include #include #include namespace osquery { template void do_release_boost(typename boost::shared_ptr const&, T*) {} /** * @brief Convert a boost::shared_ptr to a std::shared_ptr */ template typename std::shared_ptr boost_to_std_shared_ptr( typename boost::shared_ptr const& p) { return std::shared_ptr(p.get(), boost::bind(&do_release_boost, p, _1)); } template void do_release_std(typename std::shared_ptr const&, T*) {} /** * @brief Convert a std::shared_ptr to a boost::shared_ptr */ template typename boost::shared_ptr std_to_boost_shared_ptr( typename std::shared_ptr const& p) { return boost::shared_ptr(p.get(), boost::bind(&do_release_std, p, _1)); } }