#ifndef VARIANT_INL_H_ #error "Direct inclusion of this file is not allowed, include variant.h" // For the sake of sane code completion. #include "variant.h" #endif #include namespace NYT { //////////////////////////////////////////////////////////////////////////////// namespace NDetail { template struct TVariantFormatter; template struct TVariantFormatter { template static void Do(TStringBuilderBase* /*builder*/, const TVariant& /*variant*/, TStringBuf /*spec*/) { } }; template struct TVariantFormatter { template static void Do(TStringBuilderBase* builder, const TVariant& variant, TStringBuf spec) { if (variant.index() == Index) { FormatValue(builder, std::get(variant), spec); } else { TVariantFormatter::Do(builder, variant, spec); } } }; } // namespace NDetail template void FormatValue(TStringBuilderBase* builder, const std::variant& variant, TStringBuf spec) { NDetail::TVariantFormatter<0, Ts...>::Do(builder, variant, spec); } //////////////////////////////////////////////////////////////////////////////// } // namespace NYT