#ifndef FORMAT_ARG_INL_H_ #error "Direct inclusion of this file is not allowed, include format_arg.h" // For the sake of sane code completion. #include "format_arg.h" #endif namespace NYT { //////////////////////////////////////////////////////////////////////////////// namespace NDetail { template constexpr std::string_view QualidName() { constexpr size_t openBracketOffset = 5; constexpr size_t closeBracketOffset = 1; constexpr std::string_view func = __PRETTY_FUNCTION__; constexpr auto left = std::find(std::begin(func), std::end(func), '[') + openBracketOffset; return std::string_view(left, std::prev(std::end(func), closeBracketOffset)); } template constexpr bool IsNYTName() { constexpr auto qualidName = QualidName(); return qualidName.find("NYT::") == 0; } template constexpr bool IsStdName() { constexpr auto qualidName = QualidName(); return qualidName.find("std::") == 0; } } // namespace NDetail //////////////////////////////////////////////////////////////////////////////// template List, class TFrom> consteval auto TFormatArgBase::ExtendConversion() { static_assert(std::same_as || CFormattable); return AppendArrays::ConversionSpecifiers>(); } template List, class TFrom> consteval auto TFormatArgBase::ExtendFlags() { static_assert(std::same_as || CFormattable); return AppendArrays::FlagSpecifiers>(); } template List, auto* From> consteval auto TFormatArgBase::AppendArrays() { auto& from = *From; return [] ( std::index_sequence, std::index_sequence) { if constexpr (Hot) { return std::array{List[J]..., from[I]...}; } else { return std::array{from[I]..., List[J]...}; } } ( std::make_index_sequence(), std::make_index_sequence()); } //////////////////////////////////////////////////////////////////////////////// } // namespace NYT