Advertisement
Transformator

Untitled

May 23rd, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.32 KB | None | 0 0
  1. scht.cpp: In static member function ‘static std::string scht::getFriend(int):
  2. scht.cpp:24:70: error: ISO C++ forbids casting to an array type ‘std::string [] {aka std::basic_string<char> []}
  3.  string scht::getFriend(int index) { return (string[])friends.at(index); }
  4.                                                                       ^
  5. In file included from /usr/include/c++/4.8/vector:64:0,
  6.                  from scht.cpp:2:
  7. /usr/include/c++/4.8/bits/stl_vector.h: In instantiation of ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = std::basic_string<char> []; _Alloc = std::allocator<std::basic_string<char> []>; std::vector<_Tp, _Alloc>::reference = std::basic_string<char> (&)[]; std::vector<_Tp, _Alloc>::size_type = long unsigned int]:
  8. /usr/include/c++/4.8/bits/stl_vector.h:813:16:   required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(std::vector<_Tp, _Alloc>::size_type) [with _Tp = std::basic_string<char> []; _Alloc = std::allocator<std::basic_string<char> []>; std::vector<_Tp, _Alloc>::reference = std::basic_string<char> (&)[]; std::vector<_Tp, _Alloc>::size_type = long unsigned int]
  9. scht.cpp:24:70:   required from here
  10. /usr/include/c++/4.8/bits/stl_vector.h:771:41: error: invalid use of array with unspecified bounds
  11.        { return *(this->_M_impl._M_start + __n); }
  12.                                          ^
  13. In file included from /usr/include/c++/4.8/vector:69:0,
  14.                  from scht.cpp:2:
  15. /usr/include/c++/4.8/bits/vector.tcc: In instantiation of ‘void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {std::basic_string<char, std::char_traits<char>, std::allocator<char> > []}; _Tp = std::basic_string<char> []; _Alloc = std::allocator<std::basic_string<char> []>]:
  16. /usr/include/c++/4.8/bits/stl_vector.h:920:36:   required from ‘void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::basic_string<char> []; _Alloc = std::allocator<std::basic_string<char> []>; std::vector<_Tp, _Alloc>::value_type = std::basic_string<char> []]
  17. scht.cpp:33:37:   required from here
  18. /usr/include/c++/4.8/bits/vector.tcc:98:6: error: cannot increment a pointer to incomplete type ‘std::basic_string<char> []
  19.       ++this->_M_impl._M_finish;
  20.       ^
  21. In file included from /usr/include/c++/4.8/vector:64:0,
  22.                  from scht.cpp:2:
  23. /usr/include/c++/4.8/bits/stl_vector.h: In instantiation of ‘std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = std::basic_string<char> []; _Alloc = std::allocator<std::basic_string<char> []>; std::vector<_Tp, _Alloc>::size_type = long unsigned int]:
  24. /usr/include/c++/4.8/bits/stl_vector.h:793:10:   required from ‘void std::vector<_Tp, _Alloc>::_M_range_check(std::vector<_Tp, _Alloc>::size_type) const [with _Tp = std::basic_string<char> []; _Alloc = std::allocator<std::basic_string<char> []>; std::vector<_Tp, _Alloc>::size_type = long unsigned int]
  25. /usr/include/c++/4.8/bits/stl_vector.h:812:20:   required from ‘std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(std::vector<_Tp, _Alloc>::size_type) [with _Tp = std::basic_string<char> []; _Alloc = std::allocator<std::basic_string<char> []>; std::vector<_Tp, _Alloc>::reference = std::basic_string<char> (&)[]; std::vector<_Tp, _Alloc>::size_type = long unsigned int]
  26. scht.cpp:24:70:   required from here
  27. /usr/include/c++/4.8/bits/stl_vector.h:646:50: error: invalid use of array with unspecified bounds
  28.        { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); }
  29.                                                   ^
  30. In file included from /usr/include/x86_64-linux-gnu/c++/4.8/bits/c++allocator.h:33:0,
  31.                  from /usr/include/c++/4.8/bits/allocator.h:46,
  32.                  from /usr/include/c++/4.8/string:41,
  33.                  from /usr/include/c++/4.8/bits/locale_classes.h:40,
  34.                  from /usr/include/c++/4.8/bits/ios_base.h:41,
  35.                  from /usr/include/c++/4.8/ios:42,
  36.                  from /usr/include/c++/4.8/ostream:38,
  37.                  from /usr/include/c++/4.8/iostream:39,
  38.                  from scht.cpp:1:
  39. /usr/include/c++/4.8/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::basic_string<char> []; _Args = {std::basic_string<char, std::char_traits<char>, std::allocator<char> > []}; _Tp = std::basic_string<char> []]:
  40. /usr/include/c++/4.8/bits/alloc_traits.h:254:4:   required from ‘static typename std::enable_if<std::allocator_traits<_Alloc>::__construct_helper<_Tp, _Args>::value, void>::type std::allocator_traits<_Alloc>::_S_construct(_Alloc&, _Tp*, _Args&& ...) [with _Tp = std::basic_string<char> []; _Args = {std::basic_string<char, std::char_traits<char>, std::allocator<char> > []}; _Alloc = std::allocator<std::basic_string<char> []>; typename std::enable_if<std::allocator_traits<_Alloc>::__construct_helper<_Tp, _Args>::value, void>::type = void]
  41. /usr/include/c++/4.8/bits/alloc_traits.h:393:57:   required from ‘static decltype (_S_construct(__a, __p, (forward<_Args>)(std::allocator_traits::construct::__args)...)) std::allocator_traits<_Alloc>::construct(_Alloc&, _Tp*, _Args&& ...) [with _Tp = std::basic_string<char> []; _Args = {std::basic_string<char, std::char_traits<char>, std::allocator<char> > []}; _Alloc = std::allocator<std::basic_string<char> []>; decltype (_S_construct(__a, __p, (forward<_Args>)(std::allocator_traits::construct::__args)...)) = <type error>]
  42. /usr/include/c++/4.8/bits/vector.tcc:97:40:   required from ‘void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {std::basic_string<char, std::char_traits<char>, std::allocator<char> > []}; _Tp = std::basic_string<char> []; _Alloc = std::allocator<std::basic_string<char> []>]
  43. /usr/include/c++/4.8/bits/stl_vector.h:920:36:   required from ‘void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::basic_string<char> []; _Alloc = std::allocator<std::basic_string<char> []>; std::vector<_Tp, _Alloc>::value_type = std::basic_string<char> []]
  44. scht.cpp:33:37:   required from here
  45. /usr/include/c++/4.8/ext/new_allocator.h:120:4: error: invalid use of array with unspecified bounds
  46.   { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement