@@ -890,7 +890,7 @@ std::any Literal::value() const noexcept {
890890 });
891891}
892892
893- Literal Literal::cast (IRI const &target , storage::DynNodeStoragePtr node_storage) const {
893+ Literal Literal::cast_impl (datatypes::registry::DatatypeIDView target_dtid , storage::DynNodeStoragePtr node_storage) const {
894894 using namespace datatypes ::registry;
895895 using namespace datatypes ::xsd;
896896
@@ -901,7 +901,6 @@ Literal Literal::cast(IRI const &target, storage::DynNodeStoragePtr node_storage
901901 node_storage = select_node_storage (node_storage);
902902
903903 auto const this_dtid = this ->datatype_id ();
904- DatatypeIDView const target_dtid{target};
905904
906905 if (this_dtid == target_dtid) {
907906 return this ->to_node_storage (node_storage);
@@ -911,7 +910,7 @@ Literal Literal::cast(IRI const &target, storage::DynNodeStoragePtr node_storage
911910 // string -> any
912911 try {
913912 auto const lex = this ->lexical_form ();
914- return Literal::make_typed (lex, target , node_storage);
913+ return Literal::make_typed (lex, IRI{target_dtid, node_storage} , node_storage);
915914 } catch (...) {
916915 return Literal{};
917916 }
@@ -984,6 +983,10 @@ Literal Literal::cast(IRI const &target, storage::DynNodeStoragePtr node_storage
984983 return Literal{};
985984}
986985
986+ Literal Literal::cast (IRI const &target, storage::DynNodeStoragePtr node_storage) const {
987+ return this ->cast_impl (static_cast <datatypes::registry::DatatypeIDView>(target), node_storage);
988+ }
989+
987990template <typename OpSelect>
988991 requires std::is_nothrow_invocable_r_v<datatypes::registry::DatatypeRegistry::binop_fptr_t , OpSelect, datatypes::registry::DatatypeRegistry::NumericOpsImpl const &>
989992Literal Literal::numeric_binop_impl (OpSelect op_select, Literal const &other, storage::DynNodeStoragePtr node_storage) const {
0 commit comments