Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Reflection for Clang C++20


Example

#include <string>
#include <vector>
#include "json.h"

struct Profile {
  std::string name;
  std::string date;
};

struct Root {
  std::vector<Profile> profiles;
};

int main()
{
  Root root;
  root.profiles.emplace_back("Hello", "1980-01-01");
  root.profiles.emplace_back("World", "2000-01-01");

  xlegend::serdes::json json;
  xlegend::serdes::serialize(json, root);
  printf("%s\n", json.c_str());

  return 0;
}

Result

{
 "profiles" :
 [
  {
   "name" : "Hello",
   "date" : "1980-01-01"
  },
  {
   "name" : "World",
   "date" : "2000-01-01"
  }
 ]
}

About

C++ Reflection by Clang

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages