-
-
Notifications
You must be signed in to change notification settings - Fork 262
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Sample code: https://cppinsights.io/s/84d98d4f
Consider the specialisation tnt::serializer<my_type> instantiated. It generates the following code:
/* First instantiated from: insights.cpp:98 */
#ifdef INSIGHTS_USE_TEMPLATE
template<>
struct serializer final<my_type> // notice the type after `final`
{
template<typename Vis>
static inline constexpr void get_visit(Vis && vis);
/* First instantiated from: insights.cpp:98 */
#ifdef INSIGHTS_USE_TEMPLATE
template<>
static inline constexpr void get_visit<printer<my_type> &>(printer<my_type> & vis)
{
wrap.operator()(std::forward<printer<my_type> &>(vis));
}
#endif
inline static constexpr const wrapper<my_type> wrap = wrapper<my_type>();
};
#endifThe same applies to user-defined specialisations like tnt::wrapper<my_type> from the same code
template<>
struct tnt::wrapper final<my_type> // notice the type after `final`
{
template<typename Vis>
inline constexpr void operator()(Vis && vis) const
{
vis("a", &my_type::a);
vis("b", &my_type::b);
}
/* First instantiated from: insights.cpp:68 */
#ifdef INSIGHTS_USE_TEMPLATE
template<>
inline constexpr void operator()<tnt::printer<my_type> &>(tnt::printer<my_type> & vis) const
{
vis.operator()(std::basic_string_view<char, std::char_traits<char> >("a"), &my_type::a);
vis.operator()(std::basic_string_view<char, std::char_traits<char> >("b"), &my_type::b);
}Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working