Skip to content

<vector>: Superior string splitting (std::views::split) issue with VS2002 17.4 Preview 2 #3109

Description

@fsb4000

Describe the bug
An example from https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2210r0.html#design doesn't work but it worked in 17.3

Command-line test case

C:\Temp>type main.cpp
#include <string>
#include <ranges>
#include <vector>

int main()
{
	std::string ip = "127.0.0.1";
	auto parts = ip | std::views::split('.');
	auto as_vec = std::vector<std::string>(parts.begin(), parts.end());
	return 0;
}
C:\Temp>cl /std:c++latest /EHsc /W4 /WX .\main.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.34.31823.3 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

/std:c++latest is provided as a preview of language features from the latest C++
working draft, and we're eager to hear about bugs and suggestions for improvements.
However, note that these features are provided as-is without support, and subject
to changes or removal as the working draft evolves. See
https://go.microsoft.com/fwlink/?linkid=2045807 for details.

main.cpp
C:\Dev\STL\out\build\x64\out\inc\xutility(217): error C2665: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string': no overloaded function could convert all the argument types
C:\Dev\STL\out\build\x64\out\inc\xstring(2678): note: could be 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::nullptr_t)'
C:\Dev\STL\out\build\x64\out\inc\xutility(217): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::nullptr_t)': cannot convert argument 1 from '_Ty' to 'std::nullptr_t'
        with
        [
            _Ty=std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::ranges::subrange_kind::sized>
        ]
C:\Dev\STL\out\build\x64\out\inc\xutility(217): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Dev\STL\out\build\x64\out\inc\xstring(2673): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _Elem *const )'
        with
        [
            _Elem=char
        ]
C:\Dev\STL\out\build\x64\out\inc\xutility(217): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _Elem *const )': cannot convert argument 1 from '_Ty' to 'const _Elem *const '
        with
        [
            _Elem=char
        ]
        and
        [
            _Ty=std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::ranges::subrange_kind::sized>
        ]
        and
        [
            _Elem=char
        ]
C:\Dev\STL\out\build\x64\out\inc\xutility(217): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Dev\STL\out\build\x64\out\inc\xstring(3221): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::initializer_list<_Elem>,const _Alloc &)'
        with
        [
            _Elem=char,
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xutility(217): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::initializer_list<_Elem>,const _Alloc &)': cannot convert argument 1 from '_Ty' to 'std::initializer_list<_Elem>'
        with
        [
            _Elem=char,
            _Alloc=std::allocator<char>
        ]
        and
        [
            _Ty=std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::ranges::subrange_kind::sized>
        ]
        and
        [
            _Elem=char
        ]
C:\Dev\STL\out\build\x64\out\inc\xutility(217): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Dev\STL\out\build\x64\out\inc\xstring(2619): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _Alloc &) noexcept'
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xutility(217): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _Alloc &) noexcept': cannot convert argument 1 from '_Ty' to 'const _Alloc &'
        with
        [
            _Alloc=std::allocator<char>
        ]
        and
        [
            _Ty=std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::ranges::subrange_kind::sized>
        ]
        and
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xutility(217): note: Reason: cannot convert from '_Ty' to 'const _Alloc'
        with
        [
            _Ty=std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::ranges::subrange_kind::sized>
        ]
        and
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xutility(217): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Dev\STL\out\build\x64\out\inc\xstring(3028): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _Ty &,const unsigned __int64,const unsigned __int64,const _Alloc &)'
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xutility(217): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _Ty &,const unsigned __int64,const unsigned __int64,const _Alloc &)': expects 4 arguments - 1 provided
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xstring(3028): note: see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string'
C:\Dev\STL\out\build\x64\out\inc\xstring(3021): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _StringViewIsh &,const _Alloc &)'
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xutility(217): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _StringViewIsh &,const _Alloc &)': could not deduce template argument for '__formal'
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xstring(3021): note: see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string'
C:\Dev\STL\out\build\x64\out\inc\xstring(2871): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::from_range_t,_Rng &&,const _Alloc &)'
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xutility(217): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::from_range_t,_Rng &&,const _Alloc &)': expects 3 arguments - 1 provided
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xstring(2871): note: see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string'
C:\Dev\STL\out\build\x64\out\inc\xstring(2703): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(_Iter,_Iter,const _Alloc &)'
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xutility(217): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(_Iter,_Iter,const _Alloc &)': expects 3 arguments - 1 provided
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xstring(2703): note: see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string'
C:\Dev\STL\out\build\x64\out\inc\xstring(2697): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const unsigned __int64,const _Elem,const _Alloc &)'
        with
        [
            _Elem=char,
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xutility(217): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const unsigned __int64,const _Elem,const _Alloc &)': expects 3 arguments - 1 provided
        with
        [
            _Elem=char,
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xstring(2697): note: see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string'
C:\Dev\STL\out\build\x64\out\inc\xstring(2684): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _Elem *const ,const _Alloc &)'
        with
        [
            _Elem=char,
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xutility(217): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _Elem *const ,const _Alloc &)': expects 2 arguments - 1 provided
        with
        [
            _Elem=char,
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xstring(2684): note: see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string'
C:\Dev\STL\out\build\x64\out\inc\xutility(217): note: while trying to match the argument list '(_Ty)'
        with
        [
            _Ty=std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::ranges::subrange_kind::sized>
        ]
C:\Dev\STL\out\build\x64\out\inc\xutility(216): note: see reference to function template instantiation '_Ty *std::construct_at<_Objty,std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::ranges::subrange_kind::sized>,0x0>(_Ty *const ,std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::ranges::subrange_kind::sized> &&) noexcept(<expr>)' being compiled
        with
        [
            _Ty=std::basic_string<char,std::char_traits<char>,std::allocator<char>>,
            _Objty=std::basic_string<char,std::char_traits<char>,std::allocator<char>>,
            _Elem=char
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(1662): note: see reference to function template instantiation 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::ranges::subrange_kind::sized>>(_Alloc &,_Objty *const ,std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::ranges::subrange_kind::sized> &&)' being compiled
        with
        [
            _Alloc=std::allocator<std::string>,
            _Ty=std::basic_string<char,std::char_traits<char>,std::allocator<char>>,
            _Elem=char,
            _Objty=std::basic_string<char,std::char_traits<char>,std::allocator<char>>
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(1663): note: see reference to function template instantiation 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::ranges::subrange_kind::sized>>(_Alloc &,_Objty *const ,std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::ranges::subrange_kind::sized> &&)' being compiled
        with
        [
            _Alloc=std::allocator<std::string>,
            _Ty=std::basic_string<char,std::char_traits<char>,std::allocator<char>>,
            _Elem=char,
            _Objty=std::basic_string<char,std::char_traits<char>,std::allocator<char>>
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(1680): note: see reference to function template instantiation 'void std::_Uninitialized_backout_al<std::allocator<std::string>>::_Emplace_back<std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::ranges::subrange_kind::sized>>(std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::ranges::subrange_kind::sized> &&)' being compiled
        with
        [
            _Elem=char
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(1717): note: see reference to function template instantiation 'void std::_Uninitialized_backout_al<std::allocator<std::string>>::_Emplace_back<std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::ranges::subrange_kind::sized>>(std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::_String_iterator<std::_String_val<std::_Simple_types<_Elem>>>,std::ranges::subrange_kind::sized> &&)' being compiled
        with
        [
            _Elem=char
        ]
C:\Dev\STL\out\build\x64\out\inc\vector(2119): note: see reference to function template instantiation 'std::basic_string<char,std::char_traits<char>,std::allocator<char>> *std::_Uninitialized_copy<_Ty,_Ty,std::allocator<std::string>>(_InIt,_Se,std::basic_string<char,std::char_traits<char>,std::allocator<char>> *,_Alloc &)' being compiled
        with
        [
            _Ty=std::ranges::split_view<std::ranges::ref_view<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::ranges::single_view<char>>::_Iterator,
            _InIt=std::ranges::split_view<std::ranges::ref_view<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::ranges::single_view<char>>::_Iterator,
            _Se=std::ranges::split_view<std::ranges::ref_view<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::ranges::single_view<char>>::_Iterator,
            _Alloc=std::allocator<std::string>
        ]
C:\Dev\STL\out\build\x64\out\inc\vector(705): note: see reference to function template instantiation 'void std::vector<std::string,std::allocator<std::string>>::_Construct_n<std::ranges::split_view<std::ranges::ref_view<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::ranges::single_view<char>>::_Iterator,std::ranges::split_view<std::ranges::ref_view<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::ranges::single_view<char>>::_Iterator>(const unsigned __int64,std::ranges::split_view<std::ranges::ref_view<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::ranges::single_view<char>>::_Iterator &&,std::ranges::split_view<std::ranges::ref_view<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::ranges::single_view<char>>::_Iterator &&)' being compiled
C:\Dev\STL\out\build\x64\out\inc\vector(705): note: see reference to function template instantiation 'void std::vector<std::string,std::allocator<std::string>>::_Construct_n<std::ranges::split_view<std::ranges::ref_view<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::ranges::single_view<char>>::_Iterator,std::ranges::split_view<std::ranges::ref_view<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::ranges::single_view<char>>::_Iterator>(const unsigned __int64,std::ranges::split_view<std::ranges::ref_view<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::ranges::single_view<char>>::_Iterator &&,std::ranges::split_view<std::ranges::ref_view<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::ranges::single_view<char>>::_Iterator &&)' being compiled
.\main.cpp(9): note: see reference to function template instantiation 'std::vector<std::string,std::allocator<std::string>>::vector<std::ranges::split_view<std::ranges::ref_view<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::ranges::single_view<char>>::_Iterator,0>(_Iter,_Iter,const _Alloc &)' being compiled
        with
        [
            _Iter=std::ranges::split_view<std::ranges::ref_view<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::ranges::single_view<char>>::_Iterator,
            _Alloc=std::allocator<std::string>
        ]
.\main.cpp(9): note: see reference to function template instantiation 'std::vector<std::string,std::allocator<std::string>>::vector<std::ranges::split_view<std::ranges::ref_view<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::ranges::single_view<char>>::_Iterator,0>(_Iter,_Iter,const _Alloc &)' being compiled
        with
        [
            _Iter=std::ranges::split_view<std::ranges::ref_view<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::ranges::single_view<char>>::_Iterator,
            _Alloc=std::allocator<std::string>
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(680): error C2665: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string': no overloaded function could convert all the argument types
C:\Dev\STL\out\build\x64\out\inc\xstring(2678): note: could be 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::nullptr_t)'
C:\Dev\STL\out\build\x64\out\inc\xmemory(680): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::nullptr_t)': cannot convert argument 1 from '_Ty' to 'std::nullptr_t'
        with
        [
            _Ty=std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::ranges::subrange_kind::sized>
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(680): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Dev\STL\out\build\x64\out\inc\xstring(2673): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _Elem *const )'
        with
        [
            _Elem=char
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(680): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _Elem *const )': cannot convert argument 1 from '_Ty' to 'const _Elem *const '
        with
        [
            _Elem=char
        ]
        and
        [
            _Ty=std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::ranges::subrange_kind::sized>
        ]
        and
        [
            _Elem=char
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(680): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Dev\STL\out\build\x64\out\inc\xstring(3221): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::initializer_list<_Elem>,const _Alloc &)'
        with
        [
            _Elem=char,
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(680): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::initializer_list<_Elem>,const _Alloc &)': cannot convert argument 1 from '_Ty' to 'std::initializer_list<_Elem>'
        with
        [
            _Elem=char,
            _Alloc=std::allocator<char>
        ]
        and
        [
            _Ty=std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::ranges::subrange_kind::sized>
        ]
        and
        [
            _Elem=char
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(680): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Dev\STL\out\build\x64\out\inc\xstring(2619): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _Alloc &) noexcept'
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(680): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _Alloc &) noexcept': cannot convert argument 1 from '_Ty' to 'const _Alloc &'
        with
        [
            _Alloc=std::allocator<char>
        ]
        and
        [
            _Ty=std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::ranges::subrange_kind::sized>
        ]
        and
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(673): note: Reason: cannot convert from '_Ty' to 'const _Alloc'
        with
        [
            _Ty=std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::ranges::subrange_kind::sized>
        ]
        and
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(680): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
C:\Dev\STL\out\build\x64\out\inc\xstring(3028): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _Ty &,const unsigned __int64,const unsigned __int64,const _Alloc &)'
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(680): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _Ty &,const unsigned __int64,const unsigned __int64,const _Alloc &)': expects 4 arguments - 1 provided
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xstring(3028): note: see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string'
C:\Dev\STL\out\build\x64\out\inc\xstring(3021): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _StringViewIsh &,const _Alloc &)'
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(673): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _StringViewIsh &,const _Alloc &)': could not deduce template argument for '__formal'
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xstring(3021): note: see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string'
C:\Dev\STL\out\build\x64\out\inc\xstring(2871): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::from_range_t,_Rng &&,const _Alloc &)'
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(680): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(std::from_range_t,_Rng &&,const _Alloc &)': expects 3 arguments - 1 provided
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xstring(2871): note: see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string'
C:\Dev\STL\out\build\x64\out\inc\xstring(2703): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(_Iter,_Iter,const _Alloc &)'
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(680): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(_Iter,_Iter,const _Alloc &)': expects 3 arguments - 1 provided
        with
        [
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xstring(2703): note: see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string'
C:\Dev\STL\out\build\x64\out\inc\xstring(2697): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const unsigned __int64,const _Elem,const _Alloc &)'
        with
        [
            _Elem=char,
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(680): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const unsigned __int64,const _Elem,const _Alloc &)': expects 3 arguments - 1 provided
        with
        [
            _Elem=char,
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xstring(2697): note: see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string'
C:\Dev\STL\out\build\x64\out\inc\xstring(2684): note: or       'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _Elem *const ,const _Alloc &)'
        with
        [
            _Elem=char,
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xmemory(680): note: 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string(const _Elem *const ,const _Alloc &)': expects 2 arguments - 1 provided
        with
        [
            _Elem=char,
            _Alloc=std::allocator<char>
        ]
C:\Dev\STL\out\build\x64\out\inc\xstring(2684): note: see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string'
C:\Dev\STL\out\build\x64\out\inc\xmemory(673): note: while trying to match the argument list '(_Ty)'
        with
        [
            _Ty=std::ranges::subrange<std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::_String_iterator<std::_String_val<std::_Simple_types<char>>>,std::ranges::subrange_kind::sized>
        ]

Expected behavior
Should compile

STL version

  • Option 2: git commit hash
https://github.com/microsoft/STL/commit/67a96a910fb53aa4bc12801fb9683d30b2647c16

Additional context
Devcom-10150447

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis issue is incorrect or by design

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions