Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me understand the problem with my code. I will add the else statements later. Here is the long list of my errors: soccer.cpp:

Please help me understand the problem with my code. I will add the else statements later. Here is the long list of my errors:

soccer.cpp: In function 'int main()':

soccer.cpp:22:6: error: no match for 'operator' (operand types are 'std::istream' {aka 'std::basic_istream'} and 'std::__cxx11::string' {aka 'std::__cxx11::basic_string'})

cin;

~~~^~~~

In file included from /usr/include/c++/8/string:52,

from /usr/include/c++/8/bits/locale_classes.h:40,

from /usr/include/c++/8/bits/ios_base.h:41,

from /usr/include/c++/8/ios:42,

from /usr/include/c++/8/ostream:38,

from /usr/include/c++/8/iostream:39,

from soccer.cpp:4:

/usr/include/c++/8/bits/basic_string.h:6314:5: note: candidate: 'template std::basic_ostream<_chart _traits>& std::operator&, const std::__cxx11::basic_string<_chart _traits _alloc>&)'

operator& __os,

^~~~~~~~

/usr/include/c++/8/bits/basic_string.h:6314:5: note: template argument deduction/substitution failed:

soccer.cpp:22:9: note: 'std::istream' {aka 'std::basic_istream'} is not derived from 'std::basic_ostream<_chart _traits>'

cinx;

^

In file included from /usr/include/c++/8/bits/ios_base.h:46,

from /usr/include/c++/8/ios:42,

from /usr/include/c++/8/ostream:38,

from /usr/include/c++/8/iostream:39,

from soccer.cpp:4:

/usr/include/c++/8/system_error:217:5: note: candidate: 'template std::basic_ostream<_chart _traits>& std::operator&, const std::error_code&)'

operator& __os, const error_code& __e)

^~~~~~~~

/usr/include/c++/8/system_error:217:5: note: template argument deduction/substitution failed:

soccer.cpp:22:9: note: 'std::istream' {aka 'std::basic_istream'} is not derived from 'std::basic_ostream<_chart _traits>'

cinx;

^

In file included from /usr/include/c++/8/iostream:39,

from soccer.cpp:4:

/usr/include/c++/8/ostream:497:5: note: candidate: 'template std::basic_ostream<_chart _traits>& std::operator&, _CharT)'

operator& __out, _CharT __c)

^~~~~~~~

/usr/include/c++/8/ostream:497:5: note: template argument deduction/substitution failed:

soccer.cpp:22:9: note: 'std::istream' {aka 'std::basic_istream'} is not derived from 'std::basic_ostream<_chart _traits>'

cinx;

^

In file included from /usr/include/c++/8/iostream:39,

from soccer.cpp:4:

/usr/include/c++/8/ostream:502:5: note: candidate: 'template std::basic_ostream<_chart _traits>& std::operator&, char)'

operator& __out, char __c)

^~~~~~~~

/usr/include/c++/8/ostream:502:5: note: template argument deduction/substitution failed:

soccer.cpp:22:9: note: 'std::istream' {aka 'std::basic_istream'} is not derived from 'std::basic_ostream<_chart _traits>'

cinx;

^

In file included from /usr/include/c++/8/iostream:39,

from soccer.cpp:4:

/usr/include/c++/8/ostream:508:5: note: candidate: 'template std::basic_ostream& std::operator&, char)'

operator& __out, char __c)

^~~~~~~~

/usr/include/c++/8/ostream:508:5: note: template argument deduction/substitution failed:

soccer.cpp:22:9: note: 'std::istream' {aka 'std::basic_istream'} is not derived from 'std::basic_ostream'

cinx;

^

In file included from /usr/include/c++/8/iostream:39,

from soccer.cpp:4:

/usr/include/c++/8/ostream:514:5: note: candidate: 'template std::basic_ostream& std::operator&, signed char)'

operator& __out, signed char __c)

^~~~~~~~

/usr/include/c++/8/ostream:514:5: note: template argument deduction/substitution failed:

soccer.cpp:22:9: note: 'std::istream' {aka 'std::basic_istream'} is not derived from 'std::basic_ostream'

cinx;

^

In file included from /usr/include/c++/8/iostream:39,

from soccer.cpp:4:

/usr/include/c++/8/ostream:519:5: note: candidate: 'template std::basic_ostream& std::operator&, unsigned char)'

operator& __out, unsigned char __c)

^~~~~~~~

/usr/include/c++/8/ostream:519:5: note: template argument deduction/substitution failed:

soccer.cpp:22:9: note: 'std::istream' {aka 'std::basic_istream'} is not derived from 'std::basic_ostream'

cinx;

^

In file included from /usr/include/c++/8/iostream:39,

from soccer.cpp:4:

/usr/include/c++/8/ostream:539:5: note: candidate: 'template std::basic_ostream<_chart _traits>& std::operator&, const _CharT*)'

operator& __out, const _CharT* __s)

^~~~~~~~

/usr/include/c++/8/ostream:539:5: note: template argument deduction/substitution failed:

soccer.cpp:22:9: note: 'std::istream' {aka 'std::basic_istream'} is not derived from 'std::basic_ostream<_chart _traits>'

cinx;

^

In file included from /usr/include/c++/8/ostream:693,

from /usr/include/c++/8/iostream:39,

from soccer.cpp:4:

/usr/include/c++/8/bits/ostream.tcc:321:5: note: candidate: 'template std::basic_ostream<_chart _traits>& std::operator&, const char*)'

operator& __out, const char* __s)

^~~~~~~~

/usr/include/c++/8/bits/ostream.tcc:321:5: note: template argument deduction/substitution failed:

soccer.cpp:22:9: note: 'std::istream' {aka 'std::basic_istream'} is not derived from 'std::basic_ostream<_chart _traits>'

cinx;

^

In file included from /usr/include/c++/8/iostream:39,

from soccer.cpp:4:

/usr/include/c++/8/ostream:556:5: note: candidate: 'template std::basic_ostream& std::operator&, const char*)'

operator& __out, const char* __s)

^~~~~~~~

/usr/include/c++/8/ostream:556:5: note: template argument deduction/substitution failed:

soccer.cpp:22:9: note: 'std::istream' {aka 'std::basic_istream'} is not derived from 'std::basic_ostream'

cinx;

^

In file included from /usr/include/c++/8/iostream:39,

from soccer.cpp:4:

/usr/include/c++/8/ostream:569:5: note: candidate: 'template std::basic_ostream& std::operator&, const signed char*)'

operator& __out, const signed char* __s)

^~~~~~~~

/usr/include/c++/8/ostream:569:5: note: template argument deduction/substitution failed:

soccer.cpp:22:9: note: 'std::istream' {aka 'std::basic_istream'} is not derived from 'std::basic_ostream'

cinx;

^

In file included from /usr/include/c++/8/iostream:39,

from soccer.cpp:4:

/usr/include/c++/8/ostream:574:5: note: candidate: 'template std::basic_ostream& std::operator&, const unsigned char*)'

operator& __out, const unsigned char* __s)

^~~~~~~~

/usr/include/c++/8/ostream:574:5: note: template argument deduction/substitution failed:

soccer.cpp:22:9: note: 'std::istream' {aka 'std::basic_istream'} is not derived from 'std::basic_ostream'

cinx;

^

In file included from /usr/include/c++/8/iostream:39,

from soccer.cpp:4:

/usr/include/c++/8/ostream:682:5: note: candidate: 'template typename std::enable_if<:__and_> >, std::__is_convertible_to_basic_ostream<_ostream>, std::__is_insertable::__ostream_type, const _Tp&, void> >::value, typename std::__is_convertible_to_basic_ostream<_tp>::__ostream_type>::type std::operator'

operator

^~~~~~~~

/usr/include/c++/8/ostream:682:5: note: template argument deduction/substitution failed:

/usr/include/c++/8/ostream: In substitution of 'template typename std::enable_if<:__and_> >, std::__is_convertible_to_basic_ostream<_ostream>, std::__is_insertable::__ostream_type, const _Tp&, void> >::value, typename std::__is_convertible_to_basic_ostream<_tp>::__ostream_type>::type std::operator&; _Tp = std::__cxx11::basic_string]':

soccer.cpp:22:9: required from here

/usr/include/c++/8/ostream:682:5: error: no type named 'type' in 'struct std::enable_if'

image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

5. Describe the visual representations, or models, of communication

Answered: 1 week ago