diff --git a/tesseract_common/include/tesseract_common/std_variant_serialization.h b/tesseract_common/include/tesseract_common/std_variant_serialization.h index 1729758fa53..1f82be14496 100644 --- a/tesseract_common/include/tesseract_common/std_variant_serialization.h +++ b/tesseract_common/include/tesseract_common/std_variant_serialization.h @@ -29,177 +29,166 @@ #include #include -namespace boost { -namespace serialization { - -template +namespace boost +{ +namespace serialization +{ +template struct std_variant_save_visitor { - std_variant_save_visitor(Archive& ar) : - m_ar(ar) - {} - template - void operator()(T const & value) const - { - m_ar << BOOST_SERIALIZATION_NVP(value); - } + std_variant_save_visitor(Archive& ar) : m_ar(ar) {} + template + void operator()(T const& value) const + { + m_ar << BOOST_SERIALIZATION_NVP(value); + } + private: - Archive & m_ar; + Archive& m_ar; }; - -template +template struct std_variant_load_visitor { - std_variant_load_visitor(Archive& ar) : - m_ar(ar) - {} - template - void operator()(T & value) const - { - m_ar >> BOOST_SERIALIZATION_NVP(value); - } + std_variant_load_visitor(Archive& ar) : m_ar(ar) {} + template + void operator()(T& value) const + { + m_ar >> BOOST_SERIALIZATION_NVP(value); + } + private: - Archive & m_ar; + Archive& m_ar; }; -template -void save( - Archive & ar, - std::variant const & v, - unsigned int /*version*/ -){ - const std::size_t which = v.index(); - ar << BOOST_SERIALIZATION_NVP(which); - std_variant_save_visitor visitor(ar); - std::visit(visitor, v); +template +void save(Archive& ar, std::variant const& v, unsigned int /*version*/ +) +{ + const std::size_t which = v.index(); + ar << BOOST_SERIALIZATION_NVP(which); + std_variant_save_visitor visitor(ar); + std::visit(visitor, v); } // Minimalist metaprogramming for handling parameter pack -namespace mp { - namespace detail { - template - struct front_impl; +namespace mp +{ +namespace detail +{ +template +struct front_impl; - template