Skip to content

davidkennedydev/introspecto-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introspecto C++

Simple tool to provide reflection/introspection information.

How it works

  1. Build the inspecto executable
  2. Use inspecto sample/test.cpp to parse and generate constexpr representation of classes and structures.
  3. Include instrospecto.h and write common code that uses the interface
#include "person.hpp"
#include <introspecto.h>
#include <iostream>

int main() {

  Person person{18, "ze zim"};

  auto personInfo = introspecto::introspect(person);

  personInfo.foreachField(
      [](const std::string_view name, const auto value) {
        std::cout << name << " = " << value << '\n';
      });
}

Dependencies

  • C++ STL (commonly already included in the toolchain/OS)
  • GCC compiler with C++23 support (commonly the default compiler)
  • Clang + LLVM with C++2b support (easy to install using any package manager)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages