79832195

Date: 2025-11-28 02:08:19
Score: 2
Natty:
Report link

Can we replace the argument type to variant ?

template <typename ...T >
struct User
{
    using ArgType = std::variant<T...>;

    virtual void Send_Data(const ArgType& Data) const
    {
        std::visit([](auto x) { std::cout << "Send " << x << "\n";  }, Data);
    };

    virtual void Receive_Data(const ArgType& Data) const
    {
        std::visit([](auto x) { std::cout << "Receive " << x << "\n";   }, Data);
    }
};
Reasons:
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): Can we
Posted by: fana