repr 0.1
Reconstructable string representations and more
Loading...
Searching...
No Matches
simple.cpp

Simple Example

Simple example showcasing type and value serialization.

//* c++ gsnapshot -std=c++20 -O3
#include <repr>
#include <variant>
#include <unordered_map>
#include <iostream>
struct CustomType {
char foo;
unsigned bar;
};
int main() {
auto object = CustomType{'f', 42U, true, {{1, 2}, {3, 4}}};
std::cout << "Object: " << repr(object) << '\n';
}
std::string code_for()
Definition repr:39
constexpr ::librepr::ReprWrapper repr
Definition repr:59