This commit is contained in:
Robin Sommer 2024-05-13 09:25:37 +02:00
parent a9649026ae
commit 747e26297b
No known key found for this signature in database
GPG key ID: D8187293B3FFE5D0
2 changed files with 6 additions and 7 deletions

@ -1 +1 @@
Subproject commit 92f76542eebfcc24b0212aa6c63a3b7af1a0f840 Subproject commit 2f513be28536067afb1c6f60eaa2fbca01b0ce7e

View file

@ -7,7 +7,6 @@
#pragma once #pragma once
#include <limits> #include <limits>
#include <memory>
#include <optional> #include <optional>
#include <ostream> #include <ostream>
#include <string> #include <string>
@ -489,8 +488,8 @@ template<typename T>
ValPtr to_val(const hilti::rt::Vector<T>& v, const TypePtr& target); ValPtr to_val(const hilti::rt::Vector<T>& v, const TypePtr& target);
template<typename T> template<typename T>
ValPtr to_val(const std::optional<T>& t, const TypePtr& target); ValPtr to_val(const std::optional<T>& t, const TypePtr& target);
template<typename T> template<typename T, typename E>
ValPtr to_val(const hilti::rt::DeferredExpression<T>& t, const TypePtr& target); ValPtr to_val(const hilti::rt::DeferredExpression<T, E>& t, const TypePtr& target);
template<typename T> template<typename T>
ValPtr to_val(hilti::rt::integer::safe<T> i, const TypePtr& target); ValPtr to_val(hilti::rt::integer::safe<T> i, const TypePtr& target);
template<typename T> template<typename T>
@ -519,13 +518,13 @@ inline ValPtr to_val(const std::optional<T>& t, const TypePtr& target) {
} }
/** /**
* Converts a Spicy-side DeferredExpression<T> value to a Zeek value. Such * Converts a Spicy-side DeferredExpression<T,E> value to a Zeek value. Such
* result values are returned by the ``.?`` operator. If the result is not * result values are returned by the ``.?`` operator. If the result is not
* set, this will convert into nullptr (which the tuple-to-record to_val() * set, this will convert into nullptr (which the tuple-to-record to_val()
* picks up on). * picks up on).
*/ */
template<typename T> template<typename T, typename E>
inline ValPtr to_val(const hilti::rt::DeferredExpression<T>& t, const TypePtr& target) { inline ValPtr to_val(const hilti::rt::DeferredExpression<T, E>& t, const TypePtr& target) {
try { try {
return to_val(t(), target); return to_val(t(), target);
} catch ( const hilti::rt::AttributeNotSet& ) { } catch ( const hilti::rt::AttributeNotSet& ) {