We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorry if I missed this, but I checked the discussions and searched the doc, but I can't see how to make this work.
#include "zpp_bits.h" #include <string> #include <variant> #include <vector> struct s : public std::variant< int, std::string > { bool holds_id() const { return std::holds_alternative< int >( *this ); } int get_id() const { return std::get< int >( *this ); } bool holds_name() const { return std::holds_alternative< std::string >( *this ); } std::string get_name() const { return std::get< std::string >( *this ); } using base = std::variant< int, std::string >; using base::base; using base::operator=; }; int main() { s an_s; an_s = 34; std::vector< char > v; zpp::bits::out out{ v }; auto result = out( an_s ); if ( failure( result ) ) { return 1; } return 0; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Sorry if I missed this, but I checked the discussions and searched the doc, but I can't see how to make this work.
The text was updated successfully, but these errors were encountered: