#include <vector>
#include <string>
void foo(const std::vector<const std::string> &arg){}
int main() {
std::vector<std::string> v = {"hello", "world"};
foo(v);
}
I2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPHN0cmluZz4KCnZvaWQgZm9vKGNvbnN0IHN0ZDo6dmVjdG9yPGNvbnN0IHN0ZDo6c3RyaW5nPiAmYXJnKXt9CgppbnQgbWFpbigpIHsKCXN0ZDo6dmVjdG9yPHN0ZDo6c3RyaW5nPiB2ID0geyJoZWxsbyIsICJ3b3JsZCJ9OwoJZm9vKHYpOwp9
In file included from /usr/include/i386-linux-gnu/c++/5/bits/c++allocator.h:33:0,
from /usr/include/c++/5/bits/allocator.h:46,
from /usr/include/c++/5/vector:61,
from prog.cpp:1:
/usr/include/c++/5/ext/new_allocator.h: In instantiation of 'struct __gnu_cxx::new_allocator<const std::basic_string<char> >':
/usr/include/c++/5/bits/allocator.h:92:11: required from 'class std::allocator<const std::basic_string<char> >'
/usr/include/c++/5/bits/alloc_traits.h:88:43: required from 'struct std::allocator_traits<std::allocator<const std::basic_string<char> > >'
/usr/include/c++/5/ext/alloc_traits.h:95:10: required from 'struct __gnu_cxx::__alloc_traits<std::allocator<const std::basic_string<char> > >'
/usr/include/c++/5/bits/stl_vector.h:75:28: required from 'struct std::_Vector_base<const std::basic_string<char>, std::allocator<const std::basic_string<char> > >'
/usr/include/c++/5/bits/stl_vector.h:214:11: required from 'class std::vector<const std::basic_string<char> >'
prog.cpp:8:7: required from here
/usr/include/c++/5/ext/new_allocator.h:93:7: error: 'const _Tp* __gnu_cxx::new_allocator<_Tp>::address(__gnu_cxx::new_allocator<_Tp>::const_reference) const [with _Tp = const std::basic_string<char>; __gnu_cxx::new_allocator<_Tp>::const_pointer = const std::basic_string<char>*; __gnu_cxx::new_allocator<_Tp>::const_reference = const std::basic_string<char>&]' cannot be overloaded
address(const_reference __x) const _GLIBCXX_NOEXCEPT
^
/usr/include/c++/5/ext/new_allocator.h:89:7: error: with '_Tp* __gnu_cxx::new_allocator<_Tp>::address(__gnu_cxx::new_allocator<_Tp>::reference) const [with _Tp = const std::basic_string<char>; __gnu_cxx::new_allocator<_Tp>::pointer = const std::basic_string<char>*; __gnu_cxx::new_allocator<_Tp>::reference = const std::basic_string<char>&]'
address(reference __x) const _GLIBCXX_NOEXCEPT
^
prog.cpp: In function 'int main()':
prog.cpp:8:7: error: invalid initialization of reference of type 'const std::vector<const std::basic_string<char> >&' from expression of type 'std::vector<std::basic_string<char> >'
foo(v);
^
prog.cpp:4:6: note: in passing argument 1 of 'void foo(const std::vector<const std::basic_string<char> >&)'
void foo(const std::vector<const std::string> &arg){}
^