Вот воспроизводимый пример.
Он выглядит просто так:
Код: Выделить всё
//main.cpp
import serialisation_module; // error still occurs if you don't import (comment this out)
#include // doesn't make a difference if this is here or not.
int main()
{
}
//serialisation_module.cppm
Код: Выделить всё
module;
#include "glaze/glaze.hpp"
export module serialisation_module;
template
void read_json(T& obj_out)
{
char buff[1024];
static constexpr glz::opts options{ .error_on_unknown_keys = false };
glz::error_ctx ret_val2 = glz::read(obj_out, std::string_view(buff, 1024));
}
Подробнее здесь: https://stackoverflow.com/questions/798 ... on-library
Мобильная версия