xo-numeric/xo-printjson/include/xo/printjson/init_printjson.hpp
Roland Conybeare 9c8e23577e Add 'xo-printjson/' from commit '6743b9ef18'
git-subtree-dir: xo-printjson
git-subtree-mainline: d49c309f80
git-subtree-split: 6743b9ef18
2025-05-11 14:58:48 -05:00

29 lines
734 B
C++

/* file init_printjson.hpp
*
* author: Roland Conybeare, Sep 2022
*/
#pragma once
#include "xo/subsys/Subsystem.hpp"
namespace xo {
/* tag to represent the printjson/ subsystem within ordered initialization */
enum S_printjson_tag {};
/* Use:
* // anywhere, to declare printjson dependency e.g. at file scope
* InitEvidence s_evidence = InitSubsys<S_printjson_tag>::require();
*
* // from main(), though can resort to module initialization in a pybind11 library
* Subsystem::initialize_all();
*/
template<>
struct InitSubsys<S_printjson_tag> {
static void init();
static InitEvidence require();
};
} /*namespace xo*/
/* end init_printjson.hpp */