interval.cpp:14:10: error: reference to 'data' is ambiguous
bool cmp(data A, data B)
^~~~
interval.cpp:9:8: note: candidates are: struct data
struct data{
^~~~
In file included from /usr/include/c++/7/string:51:0,
from /usr/include/c++/7/bits/locale_classes.h:40,
from /usr/include/c++/7/bits/ios_base.h:41,
from /usr/include/c++/7/ios:42,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from interval.cpp:1:
/usr/include/c++/7/bits/range_access.h:318:5: note: template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)
data(initializer_list<_Tp> __il) noexcept
^~~~
/usr/include/c++/7/bits/range_access.h:309:5: note: template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])
data(_Tp (&__array)[_Nm]) noexcept
^~~~
/usr/include/c++/7/bits/range_access.h:299:5: note: template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)
data(const _Container& __cont) noexcept(noexcept(__cont.data()))
^~~~
/usr/include/c++/7/bits/range_access.h:289:5: note: template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)
data(_Container& __cont) noexcept(noexcept(__cont.data()))
^~~~
interval.cpp:14:18: error: reference to 'data' is ambiguous
bool cmp(data A, data B)
^~~~
interval.cpp:9:8: note: candidates are: struct data
struct data{
^~~~
In file included from /usr/include/c++/7/string:51:0,
from /usr/include/c++/7/bits/locale_classes.h:40,
from /usr/include/c++/7/bits/ios_base.h:41,
from /usr/include/c++/7/ios:42,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from interval.cpp:1:
/usr/include/c++/7/bits/range_access.h:318:5: note: template<class _Tp> constexpr const _Tp* std::data(std::initializer_list<_Tp>)
data(initializer_list<_Tp> __il) noexcept
^~~~
/usr/include/c++/7/bits/range_access.h:309:5: note: template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])
data(_Tp (&__array)[_Nm]) noexcept
^~~~
/usr/include/c++/7/bits/range_access.h:299:5: note: template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)
data(const _Container& __cont) noexcept(noexcept(__cont.data()))
^~~~
/usr/include/c++/7/bits/range_access.h:289:5: note: template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)
data(_Container& __cont) noexcept(noexcept(__cont.data()))
^~~~
interval.cpp:14:24: error: expression list treated as compound expression in initializer [-fpermissive]
bool cmp(data A, data B)
^
interval.cpp: In function 'int main()':
interval.cpp:57:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(j=0;j<a.size();j++){asum[i][j]=a[j]-'a'==i?asum[i][j-1]+1:asum[i][j-1];}
~^~~~~~~~~
interval.cpp:61:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(j=0;j<b.size();j++){bsum[i][j]=b[j]-'a'==i?bsum[i][j-1]+1:bsum[i][j-1];}
~^~~~~~~~~
interval.cpp:68:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(j=i-1;j<a.size();j++)
~^~~~~~~~~
interval.cpp:78:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(j=i-1;j<b.size();j++)
~^~~~~~~~~
interval.cpp:91:45: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while(bh[k].value<ah[j].value&&k<b.size()) k++;
~^~~~~~~~~
interval.cpp:92:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if(k>=b.size()) break;
~^~~~~~~~~~
interval.cpp:95:46: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
while(bh[k].value==ah[j].value&&k<b.size())
~^~~~~~~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:71:0,
from /usr/include/c++/7/bits/char_traits.h:39,
from /usr/include/c++/7/ios:40,
from /usr/include/c++/7/ostream:38,
from /usr/include/c++/7/iostream:39,
from interval.cpp:1:
/usr/include/c++/7/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = data*; _Iterator2 = data*; _Compare = bool]':
/usr/include/c++/7/bits/stl_algo.h:81:17: required from 'void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = data*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool>]'
/usr/include/c++/7/bits/stl_algo.h:1921:34: required from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = data*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool>]'
/usr/include/c++/7/bits/stl_algo.h:1953:38: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = data*; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool>]'
/usr/include/c++/7/bits/stl_algo.h:1968:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = data*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool>]'
/usr/include/c++/7/bits/stl_algo.h:4868:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = data*; _Compare = bool]'
interval.cpp:86:32: required from here
/usr/include/c++/7/bits/predefined_ops.h:143:18: error: expression cannot be used as a function
{ return bool(_M_comp(*__it1, *__it2)); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/7/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = data; _Iterator = data*; _Compare = bool]':
/usr/include/c++/7/bits/stl_algo.h:1828:20: required from 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = data*; _Compare = __gnu_cxx::__ops::_Val_comp_iter<bool>]'
/usr/include/c++/7/bits/stl_algo.h:1855:36: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = data*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool>]'
/usr/include/c++/7/bits/stl_algo.h:1885:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = data*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool>]'
/usr/include/c++/7/bits/stl_algo.h:1971:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = data*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool>]'
/usr/include/c++/7/bits/stl_algo.h:4868:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = data*; _Compare = bool]'
interval.cpp:86:32: required from here
/usr/include/c++/7/bits/predefined_ops.h:215:11: error: expression cannot be used as a function
{ return bool(_M_comp(__val, *__it)); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/7/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value&) [with _Iterator = data*; _Value = data; _Compare = bool]':
/usr/include/c++/7/bits/stl_heap.h:133:48: required from 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = data*; _Distance = long int; _Tp = data; _Compare = __gnu_cxx::__ops::_Iter_comp_val<bool>]'
/usr/include/c++/7/bits/stl_heap.h:237:23: required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = data*; _Distance = long int; _Tp = data; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool>]'
/usr/include/c++/7/bits/stl_heap.h:342:22: required from 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = data*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool>]'
/usr/include/c++/7/bits/stl_algo.h:1672:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = data*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool>]'
/usr/include/c++/7/bits/stl_algo.h:1933:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = data*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool>]'
/usr/include/c++/7/bits/stl_algo.h:1948:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = data*; _Size = long int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool>]'
/usr/include/c++/7/bits/stl_algo.h:1968:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = data*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool>]'
/usr/include/c++/7/bits/stl_algo.h:4868:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = data*; _Compare = bool]'
interval.cpp:86:32: required from here
/usr/include/c++/7/bits/predefined_ops.h:177:11: error: expression cannot be used as a function
{ return bool(_M_comp(*__it, __val)); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~