Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <contracts>
void handle_contract_violation(const std::contracts::contract_violation& v) {
std::cerr << "violation at " << v.location().function_name()
<< ": " << v.comment() << '\n';
std::abort();
}
struct S {
@SavenkovIgor
SavenkovIgor / reflection.cpp
Created May 1, 2026 19:52
Primitive reflection Google codestyle checker
#include <meta>
#include <string_view>
namespace meta = std::meta;
class S {
public:
int size_ = 2;
// int size = 2; // Non-compile - should end with _