/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int main()':
foo.cpp:20:9: error: reference to 'begin' is ambiguous
  cin >> begin;
         ^~~~~
foo.cpp:10:8: note: candidates are: std::__cxx11::string begin
 string begin, end, now;
        ^~~~~
In file included from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/string:51:0,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/locale_classes.h:40,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/ios_base.h:41,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ios:42,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ostream:38,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/iostream:39,
                 from foo.cpp:1:
C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/range_access.h:87:5: note:                 template<class _Tp, unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm])
     begin(_Tp (&__arr)[_Nm])
     ^~~~~
C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/range_access.h:58:5: note:                 template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)
     begin(const _Container& __cont) -> decltype(__cont.begin())
     ^~~~~
C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/range_access.h:48:5: note:                 template<class _Container> decltype (__cont.begin()) std::begin(_Container&)
     begin(_Container& __cont) -> decltype(__cont.begin())
     ^~~~~
In file included from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/range_access.h:36:0,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/string:51,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/locale_classes.h:40,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/ios_base.h:41,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ios:42,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ostream:38,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/iostream:39,
                 from foo.cpp:1:
C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/initializer_list:89:5: note:                 template<class _Tp> constexpr const _Tp* std::begin(std::initializer_list<_Tp>)
     begin(initializer_list<_Tp> __ils) noexcept
     ^~~~~
foo.cpp:21:13: error: reference to 'begin' is ambiguous
  vis.insert(begin);
             ^~~~~
foo.cpp:10:8: note: candidates are: std::__cxx11::string begin
 string begin, end, now;
        ^~~~~
In file included from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/string:51:0,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/locale_classes.h:40,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/ios_base.h:41,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ios:42,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/ostream:38,
                 from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/iostream:39,
                 from foo.cpp:1:
C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/range_access.h:87:5: note:                 template<class _Tp, unsigned int _Nm> _Tp* std::begin(_Tp (&)[_Nm])
     begin(_Tp (&__arr)[_Nm])
     ^~~~~
C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/range_access.h:58:5: note:                 template<class _Container> decltype (__cont.begin()) std::begin(const _Container&)
     begin(const _Container& __cont) -> decltype(__cont.begin())
     ^~~~~
C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/range_access.h:48:5: note:                 template<class _Container> decltype (__cont.begin()) std::begin(_Container&)
     begin(_Container& __cont) -> decltype(__cont.begin())
     ^~~~~
In file included from C:/mingw32/lib/gcc/i686-w64-mingw32/6.3.0/include/c++/bits/range_access.h

信息

递交者
类型
递交
题目
P1360 八数码问题
语言
C++
递交时间
2017-03-13 08:58:53
评测时间
2017-03-13 08:58:53
评测机
分数
0
总耗时
25078ms
峰值内存
0 Bytes