foo.cc: In function 'void g(int*, int, int)':
foo.cc:7:2: error: reference to 'end' is ambiguous
7 | end=n-1;
| ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from foo.cc:1:
/usr/include/c++/9/valarray:1244:5: note: candidates are: 'template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)'
1244 | end(const valarray<_Tp>& __va)
| ^~~
/usr/include/c++/9/valarray:1234:5: note: 'template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)'
1234 | end(valarray<_Tp>& __va)
| ^~~
In file included from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from foo.cc:1:
/usr/include/c++/9/bits/range_access.h:97:5: note: 'template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])'
97 | end(_Tp (&__arr)[_Nm])
| ^~~
/usr/include/c++/9/bits/range_access.h:78:5: note: 'template<class _Container> decltype (__cont.end()) std::end(const _Container&)'
78 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/9/bits/range_access.h:68:5: note: 'template<class _Container> decltype (__cont.end()) std::end(_Container&)'
68 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /usr/include/c++/9/bits/range_access.h:36,
from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from foo.cc:1:
/usr/include/c++/9/initializer_list:99:5: note: 'template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)'
99 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
foo.cc:4:11: note: 'int end'
4 | int start,end,sum=0,mid;
| ^~~
foo.cc:9:15: error: reference to 'end' is ambiguous
9 | while(start<=end)
| ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from foo.cc:1:
/usr/include/c++/9/valarray:1244:5: note: candidates are: 'template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)'
1244 | end(const valarray<_Tp>& __va)
| ^~~
/usr/include/c++/9/valarray:1234:5: note: 'template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)'
1234 | end(valarray<_Tp>& __va)
| ^~~
In file included from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from foo.cc:1:
/usr/include/c++/9/bits/range_access.h:97:5: note: 'template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])'
97 | end(_Tp (&__arr)[_Nm])
| ^~~
/usr/include/c++/9/bits/range_access.h:78:5: note: 'template<class _Container> decltype (__cont.end()) std::end(const _Container&)'
78 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/9/bits/range_access.h:68:5: note: 'template<class _Container> decltype (__cont.end()) std::end(_Container&)'
68 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /usr/include/c++/9/bits/range_access.h:36,
from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from foo.cc:1:
/usr/include/c++/9/initializer_list:99:5: note: 'template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)'
99 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
foo.cc:4:11: note: 'int end'
4 | int start,end,sum=0,mid;
| ^~~
foo.cc:12:13: error: reference to 'end' is ambiguous
12 | if(start==end)
| ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from foo.cc:1:
/usr/include/c++/9/valarray:1244:5: note: candidates are: 'template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)'
1244 | end(const valarray<_Tp>& __va)
| ^~~
/usr/include/c++/9/valarray:1234:5: note: 'template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)'
1234 | end(valarray<_Tp>& __va)
| ^~~
In file included from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from foo.cc:1:
/usr/include/c++/9/bits/range_access.h:97:5: note: 'template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])'
97 | end(_Tp (&__arr)[_Nm])
| ^~~
/usr/include/c++/9/bits/range_access.h:78:5: note: 'template<class _Container> decltype (__cont.end()) std::end(const _Container&)'
78 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/9/bits/range_access.h:68:5: note: 'template<class _Container> decltype (__cont.end()) std::end(_Container&)'
68 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /usr/include/c++/9/bits/range_access.h:36,
from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from foo.cc:1:
/usr/include/c++/9/initializer_list:99:5: note: 'template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)'
99 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
foo.cc:4:11: note: 'int end'
4 | int start,end,sum=0,mid;
| ^~~
foo.cc:15:24: error: reference to 'end' is ambiguous
15 | mid=(key-a[start])*(end-start)/(a[end]-a[start]);
| ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from foo.cc:1:
/usr/include/c++/9/valarray:1244:5: note: candidates are: 'template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)'
1244 | end(const valarray<_Tp>& __va)
| ^~~
/usr/include/c++/9/valarray:1234:5: note: 'template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)'
1234 | end(valarray<_Tp>& __va)
| ^~~
In file included from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from foo.cc:1:
/usr/include/c++/9/bits/range_access.h:97:5: note: 'template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])'
97 | end(_Tp (&__arr)[_Nm])
| ^~~
/usr/include/c++/9/bits/range_access.h:78:5: note: 'template<class _Container> decltype (__cont.end()) std::end(const _Container&)'
78 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/9/bits/range_access.h:68:5: note: 'template<class _Container> decltype (__cont.end()) std::end(_Container&)'
68 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /usr/include/c++/9/bits/range_access.h:36,
from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from foo.cc:1:
/usr/include/c++/9/initializer_list:99:5: note: 'template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)'
99 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
foo.cc:4:11: note: 'int end'
4 | int start,end,sum=0,mid;
| ^~~
foo.cc:15:38: error: reference to 'end' is ambiguous
15 | mid=(key-a[start])*(end-start)/(a[end]-a[start]);
| ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from foo.cc:1:
/usr/include/c++/9/valarray:1244:5: note: candidates are: 'template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)'
1244 | end(const valarray<_Tp>& __va)
| ^~~
/usr/include/c++/9/valarray:1234:5: note: 'template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)'
1234 | end(valarray<_Tp>& __va)
| ^~~
In file included from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from foo.cc:1:
/usr/include/c++/9/bits/range_access.h:97:5: note: 'template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])'
97 | end(_Tp (&__arr)[_Nm])
| ^~~
/usr/include/c++/9/bits/range_access.h:78:5: note: 'template<class _Container> decltype (__cont.end()) std::end(const _Container&)'
78 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/9/bits/range_access.h:68:5: note: 'template<class _Container> decltype (__cont.end()) std::end(_Container&)'
68 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /usr/include/c++/9/bits/range_access.h:36,
from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from foo.cc:1:
/usr/include/c++/9/initializer_list:99:5: note: 'template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)'
99 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
foo.cc:4:11: note: 'int end'
4 | int start,end,sum=0,mid;
| ^~~
foo.cc:21:4: error: reference to 'end' is ambiguous
21 | end=mid-1;
| ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from foo.cc:1:
/usr/include/c++/9/valarray:1244:5: note: candidates are: 'template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)'
1244 | end(const valarray<_Tp>& __va)
| ^~~
/usr/include/c++/9/valarray:1234:5: note: 'template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)'
1234 | end(valarray<_Tp>& __va)
| ^~~
In file included from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from foo.cc:1:
/usr/include/c++/9/bits/range_access.h:97:5: note: 'template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])'
97 | end(_Tp (&__arr)[_Nm])
| ^~~
/usr/include/c++/9/bits/range_access.h:78:5: note: 'template<class _Container> decltype (__cont.end()) std::end(const _Container&)'
78 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/9/bits/range_access.h:68:5: note: 'template<class _Container> decltype (__cont.end()) std::end(_Container&)'
68 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /usr/include/c++/9/bits/range_access.h:36,
from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from foo.cc:1:
/usr/include/c++/9/initializer_list:99:5: note: 'template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)'
99 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
foo.cc:4:11: note: 'int end'
4 | int start,end,sum=0,mid;
| ^~~
foo.cc:28:11: error: reference to 'end' is ambiguous
28 | if(start>end)
| ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:95,
from foo.cc:1:
/usr/include/c++/9/valarray:1244:5: note: candidates are: 'template<class _Tp> const _Tp* std::end(const std::valarray<_Tp>&)'
1244 | end(const valarray<_Tp>& __va)
| ^~~
/usr/include/c++/9/valarray:1234:5: note: 'template<class _Tp> _Tp* std::end(std::valarray<_Tp>&)'
1234 | end(valarray<_Tp>& __va)
| ^~~
In file included from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from foo.cc:1:
/usr/include/c++/9/bits/range_access.h:97:5: note: 'template<class _Tp, long unsigned int _Nm> _Tp* std::end(_Tp (&)[_Nm])'
97 | end(_Tp (&__arr)[_Nm])
| ^~~
/usr/include/c++/9/bits/range_access.h:78:5: note: 'template<class _Container> decltype (__cont.end()) std::end(const _Container&)'
78 | end(const _Container& __cont) -> decltype(__cont.end())
| ^~~
/usr/include/c++/9/bits/range_access.h:68:5: note: 'template<class _Container> decltype (__cont.end()) std::end(_Container&)'
68 | end(_Container& __cont) -> decltype(__cont.end())
| ^~~
In file included from /usr/include/c++/9/bits/range_access.h:36,
from /usr/include/c++/9/string:54,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/istream:38,
from /usr/include/c++/9/sstream:38,
from /usr/include/c++/9/complex:45,
from /usr/include/c++/9/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
from foo.cc:1:
/usr/include/c++/9/initializer_list:99:5: note: 'template<class _Tp> constexpr const _Tp* std::end(std::initializer_list<_Tp>)'
99 | end(initializer_list<_Tp> __ils) noexcept
| ^~~
foo.cc:4:11: note: 'int end'
4 | int start,end,sum=0,mid;
| ^~~