diff --git a/src/StdLib.jl b/src/StdLib.jl index 320f2e4..5eb4199 100644 --- a/src/StdLib.jl +++ b/src/StdLib.jl @@ -112,9 +112,9 @@ Base.cmp(a::String, b::CppBasicString) = cmp(a,String(b)) # Make sure functions taking a C++ string as argument can also take a Julia string CxxWrapCore.map_julia_arg_type(x::Type{<:StdString}) = AbstractString -StdLib.StdStringAllocated(x::String) = StdString(x) -Base.cconvert(::Type{CxxWrapCore.ConstCxxRef{StdString}}, x::String) = StdString(x) -Base.cconvert(::Type{StdLib.StdStringDereferenced}, x::String) = StdString(x) +StdLib.StdStringAllocated(x::String) = StdString(x,length(x)) +Base.cconvert(::Type{CxxWrapCore.ConstCxxRef{StdString}}, x::String) = StdString(x,length(x)) +Base.cconvert(::Type{StdLib.StdStringDereferenced}, x::String) = StdString(x,length(x)) Base.unsafe_convert(::Type{CxxWrapCore.ConstCxxRef{StdString}}, x::StdString) = ConstCxxRef(x) function StdValArray(v::Vector{T}) where {T}