mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2026-10-29 02:17:29 +08:00
Fix errors and warnings when compiling with C++26.
This commit is contained in:
parent
f635b51e3f
commit
9d1dde408c
@ -17,6 +17,7 @@
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <stdexcept>
|
||||
#include <exception>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <thread>
|
||||
|
||||
@ -32,12 +32,12 @@ namespace chaiscript {
|
||||
/// Used internally for handling a return value from a Proxy_Function call
|
||||
template<typename Ret>
|
||||
struct Handle_Return {
|
||||
template<typename T, typename = typename std::enable_if_t<std::is_trivial_v<typename std::decay_t<T>>>>
|
||||
template<typename T, typename = typename std::enable_if_t<std::is_trivially_copyable_v<typename std::decay_t<T>> && std::is_trivially_default_constructible_v<typename std::decay_t<T>>>>
|
||||
static Boxed_Value handle(T r) {
|
||||
return Boxed_Value(std::move(r), true);
|
||||
}
|
||||
|
||||
template<typename T, typename = typename std::enable_if_t<!(std::is_trivial_v<typename std::decay_t<T>>)>>
|
||||
template<typename T, typename = typename std::enable_if_t<!(std::is_trivially_copyable_v<typename std::decay_t<T>> && std::is_trivially_default_constructible_v<typename std::decay_t<T>>)>>
|
||||
static Boxed_Value handle(T &&r) {
|
||||
return Boxed_Value(std::make_shared<T>(std::forward<T>(r)), true);
|
||||
}
|
||||
|
||||
@ -410,7 +410,7 @@ namespace chaiscript {
|
||||
public:
|
||||
Dynamic_Proxy_Function_Impl(Callable t_f,
|
||||
int t_arity = -1,
|
||||
std::shared_ptr<AST_Node> t_parsenode = AST_NodePtr(),
|
||||
std::shared_ptr<AST_Node> t_parsenode = nullptr,
|
||||
Param_Types t_param_types = Param_Types(),
|
||||
Proxy_Function t_guard = Proxy_Function())
|
||||
: Dynamic_Proxy_Function(t_arity, std::move(t_parsenode), std::move(t_param_types), std::move(t_guard))
|
||||
|
||||
@ -349,14 +349,14 @@ namespace chaiscript {
|
||||
|
||||
ss << what();
|
||||
if (!call_stack.empty()) {
|
||||
ss << "during evaluation at (" << fname(call_stack[0]) << " " << startpos(call_stack[0]) << ")\n";
|
||||
ss << "during evaluation at (" << fname(call_stack.at(0)) << " " << startpos(call_stack.at(0)) << ")\n";
|
||||
ss << '\n'
|
||||
<< detail << '\n';
|
||||
ss << " " << fname(call_stack[0]) << " (" << startpos(call_stack[0]) << ") '" << pretty(call_stack[0]) << "'";
|
||||
ss << " " << fname(call_stack.at(0)) << " (" << startpos(call_stack.at(0)) << ") '" << pretty(call_stack.at(0)) << "'";
|
||||
for (size_t j = 1; j < call_stack.size(); ++j) {
|
||||
if (id(call_stack[j]) != chaiscript::AST_Node_Type::Block && id(call_stack[j]) != chaiscript::AST_Node_Type::File) {
|
||||
if (id(call_stack.at(j)) != chaiscript::AST_Node_Type::Block && id(call_stack.at(j)) != chaiscript::AST_Node_Type::File) {
|
||||
ss << '\n';
|
||||
ss << " from " << fname(call_stack[j]) << " (" << startpos(call_stack[j]) << ") '" << pretty(call_stack[j]) << "'";
|
||||
ss << " from " << fname(call_stack.at(j)) << " (" << startpos(call_stack.at(j)) << ") '" << pretty(call_stack.at(j)) << "'";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user