From 2da13befd78382cc8c6dc69eda821fb9f2e7407c Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 15 Sep 2021 03:28:29 +0300 Subject: [PATCH] Work around mysterious errors with gcc, msvc-14.1, and clang-cl --- include/boost/variant2/variant.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/variant2/variant.hpp b/include/boost/variant2/variant.hpp index c49fbb6..77d5d16 100644 --- a/include/boost/variant2/variant.hpp +++ b/include/boost/variant2/variant.hpp @@ -2255,10 +2255,10 @@ template struct ostream_insert_L } // namespace detail -template std::basic_ostream& operator<<( std::basic_ostream& os, variant const& v ) +template std::basic_ostream& operator<<( std::basic_ostream& os, variant const& v ) { - return mp11::mp_with_index( v.index(), - detail::ostream_insert_L{ os, v } ); + return mp11::mp_with_index<1 + sizeof...(T)>( v.index(), + detail::ostream_insert_L{ os, v } ); } // hashing support