1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
$ make
/usr/bin/g++ -Wall -Wextra -g test.cpp -o test
test.cpp: In function ‘bool EncyptString(std::string, int)’:
test.cpp:22:103: error: call of overloaded ‘find_first_of(bool)’ is ambiguous
if(std::string::npos == caesar.find_first_of(!"abcdefghijklmnopqrstuvwxyzABCD EFGHIJKLMNOPQRSTUVWXYZ")){
^
test.cpp:22:103: note: candidates are:
In file included from /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/string:52: 0,
from /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/bits/local e_classes.h:40,
from /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/bits/ios_b ase.h:41,
from /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/ios:42,
from /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/ostream:38 ,
from /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/iostream:3 9,
from test.cpp:8:
/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/bits/basic_string.h:1971:7: note : std::basic_string<_CharT, _Traits, _Alloc>::size_type std::basic_string<_CharT , _Traits, _Alloc>::find_first_of(const std::basic_string<_CharT, _Traits, _Allo c>&, std::basic_string<_CharT, _Traits, _Alloc>::size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; std::bas ic_string<_CharT, _Traits, _Alloc>::size_type = long unsigned int]
find_first_of(const basic_string& __str, size_type __pos = 0) const
^
/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/bits/basic_string.h:2001:7: note : std::basic_string<_CharT, _Traits, _Alloc>::size_type std::basic_string<_CharT , _Traits, _Alloc>::find_first_of(const _CharT*, std::basic_string<_CharT, _Trai ts, _Alloc>::size_type) const [with _CharT = char; _Traits = std::char_traits<ch ar>; _Alloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>:: size_type = long unsigned int]
find_first_of(const _CharT* __s, size_type __pos = 0) const
^
/usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/bits/basic_string.h:2020:7: note : std::basic_string<_CharT, _Traits, _Alloc>::size_type std::basic_string<_CharT , _Traits, _Alloc>::find_first_of(_CharT, std::basic_string<_CharT, _Traits, _Al loc>::size_type) const [with _CharT = char; _Traits = std::char_traits<char>; _A lloc = std::allocator<char>; std::basic_string<_CharT, _Traits, _Alloc>::size_ty pe = long unsigned int]
find_first_of(_CharT __c, size_type __pos = 0) const _GLIBCXX_NOEXCEPT
^
test.cpp:25:23: error: expected ‘;’ before ‘}’ token
(((c-'a')+3)%26)+'a'}
^
test.cpp:25:19: warning: statement has no effect [-Wunused-value]
(((c-'a')+3)%26)+'a'}
^
test.cpp: At global scope:
test.cpp:19:43: warning: unused parameter ‘shift’ [-Wunused-parameter]
bool EncyptString(std::string caesar, int shift)
^
test.cpp: In function ‘bool EncyptString(std::string, int)’:
test.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
makefile:10: recipe for target 'test' failed
make: *** [test] Error 1
|