From ea19e35f85c5642402df0d5319b70d8bbf584033 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Fri, 24 May 2024 16:57:16 +0200 Subject: [PATCH] Fix build when a single ctor is registered --- README.md | 27 ++++++++++--------- .../wrenpp/detail/construct_foreign_class.hpp | 5 ++-- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index ef6b209..d020e58 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,19 @@ executable('my_project', ) ``` +And the matching wrenpp.wrap file for your project (remember to update the +revision SHA and the dependency name): + +``` +[wrap-git] +url = https://alarmpi.no-ip.org/gitan/King_DuckZ/wrenpp.git +revision = ebca413c0a3e885ac1901bd555e127476c40b057 + +[provide] +wrenpp = wrenpp_dep +dependency_names = wrenpp-0.1.3 +``` + This will make Wrenpp build as part of your project with Wren's optional random module enabled. @@ -130,16 +143,6 @@ wrenpp_dep = dependency('wrenpp', version: '>=0.1.0', ) ``` -Note that when you use Wrenpp as a subproject, Wrenpp's subproject Wren will -become a sub-subproject of your project. This is how Meson works and it simply -means that in your top level source directory you will have to run this command -before you will be able to compile (Meson should detect and print this as -well): - -``` -meson wrap promote subprojects/wrenpp/subprojects/wren -``` - ### C++ ### For working examples refer to the source files in the `examples/` directory. @@ -161,8 +164,8 @@ at least. A description of all the relevant header files follows: * `def_configuration.hpp` The `DefConfiguration` struct extends the bare `Configuration` struct by providing an implementation for `write_fn`, `error_fn` and `reallocate_fn`. They are implemented in terms of `std::cout`, - `std::cerr` and `new[]`/`delete[]` respectively. You can safely ignore this - header if this is not suitable for your project. + `std::cerr` and `std::realloc`/`std::free` respectively. You can safely ignore + this header if this is not suitable for your project. Other header files are intended for Wrenpp's use and you shouldn't need to use them. You are free to use them in your project if you think the code inside is diff --git a/include/wrenpp/detail/construct_foreign_class.hpp b/include/wrenpp/detail/construct_foreign_class.hpp index 54b9e76..615a3be 100644 --- a/include/wrenpp/detail/construct_foreign_class.hpp +++ b/include/wrenpp/detail/construct_foreign_class.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020-2022, Michele Santullo +/* Copyright 2020-2024, Michele Santullo * This file is part of wrenpp. * * Wrenpp is free software: you can redistribute it and/or modify @@ -118,7 +118,8 @@ namespace wren { template constexpr void static_assert_all_packs_are_unique() { - if constexpr (sizeof...(Args) > 0) { + //If more than one arg (ctor overload) is given, check they are unique + if constexpr (sizeof...(Args) > 1) { constexpr auto dummy = AssertIfDuplicateValues::argument_count...>::value; static_assert(dummy == 1); //always true }