Open andrewkcorcoran opened 2 years ago
The closest I got is:
template <typename C>
using ThirdPartyNested = typename third_party::Derived<int, double>::template Nested2<C>;
BINLOG_ADAPT_TEMPLATE((typename C), (ThirdPartyNested<C>))
I'm unable to create a specialization (for CustomTag/CustomSerializer) for a nested template of a template:
error: template parameters not deducible in partial specialization
In an ideal situation it would be great to be able to adapt without having to know the template specialisations
e.g. Derived<T, S>::Nested2<U>
instead of Derived<int, double>::Nested2<unsigned int>
Also we might want to add a requirement to support nested concepts e.g.
template<SomeConcept T>
struct S
{
struct S2{};
template<typename U>
concept C = requires(U u)
{...};
};
BINLOG_ADAPT(S<T>);
BINLOG_ADAPT(S<T>::S2);
BINLOG_ADAPT(S<T>::C<U>);
Would you be interested in a solution (based on ADL) that requires adding a symbol to the namespace of the type that is being made loggable? Perhaps we can create something like:
namespace lib {
template<SomeConcept T>
struct S
{
struct S2{};
template<typename U>
concept C = requires(U u)
{...};
};
template <SomeConcept T, typename U>
void binlog_serializer(S<T>::C<U>) -> SomeSerializer<S<T>::C<U>>;
// ^^^-- this could be produced by a macro
} // namespace lib
(Also a question for #153)
Yea I think that would work for our case.
Such as below. If you control the classes you can have workarounds but if you want to log a class owned by non user code something more is required.