Run Code  | API  | Code Wall  | Users  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

(non?)-template template parameters for container stream insertion

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 0.72 sec, absolute service time: 0,79 sec 
fork mode |  history  | discussion
Error(s):
source_file.cpp:34:21: error: use of overloaded operator '<<' is ambiguous (with operand types 'std::ostream' (aka 'basic_ostream<char>') and 'char')
    std::cout << vf << '\n';
    ~~~~~~~~~~~~~~~ ^  ~~~~
/usr/include/c++/v1/ostream:818:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, char __c)
^
/usr/include/c++/v1/ostream:778:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, _CharT __c)
^
/usr/include/c++/v1/ostream:785:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn)
^
source_file.cpp:22:15: note: candidate function [with Container = char]
std::ostream& operator <<(std::ostream& os, const Container& objs)
              ^
/usr/include/c++/v1/ostream:198:20: note: candidate function
    basic_ostream& operator<<(int __n);
                   ^
/usr/include/c++/v1/ostream:195:20: note: candidate function
    basic_ostream& operator<<(bool __n);
                   ^
/usr/include/c++/v1/ostream:196:20: note: candidate function
    basic_ostream& operator<<(short __n);
                   ^
/usr/include/c++/v1/ostream:197:20: note: candidate function
    basic_ostream& operator<<(unsigned short __n);
                   ^
/usr/include/c++/v1/ostream:199:20: note: candidate function
    basic_ostream& operator<<(unsigned int __n);
                   ^
/usr/include/c++/v1/ostream:200:20: note: candidate function
    basic_ostream& operator<<(long __n);
                   ^
/usr/include/c++/v1/ostream:201:20: note: candidate function
    basic_ostream& operator<<(unsigned long __n);
                   ^
/usr/include/c++/v1/ostream:202:20: note: candidate function
    basic_ostream& operator<<(long long __n);
                   ^
/usr/include/c++/v1/ostream:203:20: note: candidate function
    basic_ostream& operator<<(unsigned long long __n);
                   ^
/usr/include/c++/v1/ostream:204:20: note: candidate function
    basic_ostream& operator<<(float __f);
                   ^
/usr/include/c++/v1/ostream:205:20: note: candidate function
    basic_ostream& operator<<(double __f);
                   ^
/usr/include/c++/v1/ostream:206:20: note: candidate function
    basic_ostream& operator<<(long double __f);
                   ^
/usr/include/c++/v1/ostream:825:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, signed char __c)
^
/usr/include/c++/v1/ostream:832:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, unsigned char __c)
^
source_file.cpp:37:21: error: use of overloaded operator '<<' is ambiguous (with operand types 'std::ostream' (aka 'basic_ostream<char>') and 'char')
    std::cout << lc << '\n';
    ~~~~~~~~~~~~~~~ ^  ~~~~
/usr/include/c++/v1/ostream:818:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, char __c)
^
/usr/include/c++/v1/ostream:778:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, _CharT __c)
^
/usr/include/c++/v1/ostream:785:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn)
^
source_file.cpp:22:15: note: candidate function [with Container = char]
std::ostream& operator <<(std::ostream& os, const Container& objs)
              ^
/usr/include/c++/v1/ostream:198:20: note: candidate function
    basic_ostream& operator<<(int __n);
                   ^
/usr/include/c++/v1/ostream:195:20: note: candidate function
    basic_ostream& operator<<(bool __n);
                   ^
/usr/include/c++/v1/ostream:196:20: note: candidate function
    basic_ostream& operator<<(short __n);
                   ^
/usr/include/c++/v1/ostream:197:20: note: candidate function
    basic_ostream& operator<<(unsigned short __n);
                   ^
/usr/include/c++/v1/ostream:199:20: note: candidate function
    basic_ostream& operator<<(unsigned int __n);
                   ^
/usr/include/c++/v1/ostream:200:20: note: candidate function
    basic_ostream& operator<<(long __n);
                   ^
/usr/include/c++/v1/ostream:201:20: note: candidate function
    basic_ostream& operator<<(unsigned long __n);
                   ^
/usr/include/c++/v1/ostream:202:20: note: candidate function
    basic_ostream& operator<<(long long __n);
                   ^
/usr/include/c++/v1/ostream:203:20: note: candidate function
    basic_ostream& operator<<(unsigned long long __n);
                   ^
/usr/include/c++/v1/ostream:204:20: note: candidate function
    basic_ostream& operator<<(float __f);
                   ^
/usr/include/c++/v1/ostream:205:20: note: candidate function
    basic_ostream& operator<<(double __f);
                   ^
/usr/include/c++/v1/ostream:206:20: note: candidate function
    basic_ostream& operator<<(long double __f);
                   ^
/usr/include/c++/v1/ostream:825:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, signed char __c)
^
/usr/include/c++/v1/ostream:832:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, unsigned char __c)
^
source_file.cpp:40:21: error: use of overloaded operator '<<' is ambiguous (with operand types 'std::ostream' (aka 'basic_ostream<char>') and 'char')
    std::cout << di << '\n';
    ~~~~~~~~~~~~~~~ ^  ~~~~
/usr/include/c++/v1/ostream:818:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, char __c)
^
/usr/include/c++/v1/ostream:778:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, _CharT __c)
^
/usr/include/c++/v1/ostream:785:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn)
^
source_file.cpp:22:15: note: candidate function [with Container = char]
std::ostream& operator <<(std::ostream& os, const Container& objs)
              ^
/usr/include/c++/v1/ostream:198:20: note: candidate function
    basic_ostream& operator<<(int __n);
                   ^
/usr/include/c++/v1/ostream:195:20: note: candidate function
    basic_ostream& operator<<(bool __n);
                   ^
/usr/include/c++/v1/ostream:196:20: note: candidate function
    basic_ostream& operator<<(short __n);
                   ^
/usr/include/c++/v1/ostream:197:20: note: candidate function
    basic_ostream& operator<<(unsigned short __n);
                   ^
/usr/include/c++/v1/ostream:199:20: note: candidate function
    basic_ostream& operator<<(unsigned int __n);
                   ^
/usr/include/c++/v1/ostream:200:20: note: candidate function
    basic_ostream& operator<<(long __n);
                   ^
/usr/include/c++/v1/ostream:201:20: note: candidate function
    basic_ostream& operator<<(unsigned long __n);
                   ^
/usr/include/c++/v1/ostream:202:20: note: candidate function
    basic_ostream& operator<<(long long __n);
                   ^
/usr/include/c++/v1/ostream:203:20: note: candidate function
    basic_ostream& operator<<(unsigned long long __n);
                   ^
/usr/include/c++/v1/ostream:204:20: note: candidate function
    basic_ostream& operator<<(float __f);
                   ^
/usr/include/c++/v1/ostream:205:20: note: candidate function
    basic_ostream& operator<<(double __f);
                   ^
/usr/include/c++/v1/ostream:206:20: note: candidate function
    basic_ostream& operator<<(long double __f);
                   ^
/usr/include/c++/v1/ostream:825:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, signed char __c)
^
/usr/include/c++/v1/ostream:832:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, unsigned char __c)
^
source_file.cpp:24:8: error: use of overloaded operator '<<' is ambiguous (with operand types 'std::ostream' (aka 'basic_ostream<char>') and 'const char [127]')
    os << __PRETTY_FUNCTION__ << '\n';
    ~~ ^  ~~~~~~~~~~~~~~~~~~~
source_file.cpp:34:15: note: in instantiation of function template specialization 'operator<<<std::__1::vector<float, std::__1::allocator<float> > >' requested here
    std::cout << vf << '\n';
              ^
/usr/include/c++/v1/ostream:892:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, const char* __str)
^
/usr/include/c++/v1/ostream:839:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, const _CharT* __str)
^
/usr/include/c++/v1/ostream:846:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn)
^
source_file.cpp:22:15: note: candidate function [with Container = char [127]]
std::ostream& operator <<(std::ostream& os, const Container& objs)
              ^
/usr/include/c++/v1/ostream:207:20: note: candidate function
    basic_ostream& operator<<(const void* __p);
                   ^
/usr/include/c++/v1/ostream:195:20: note: candidate function
    basic_ostream& operator<<(bool __n);
                   ^
source_file.cpp:26:19: error: use of overloaded operator '<<' is ambiguous (with operand types 'std::__1::basic_ostream<char>' and 'char')
        os << obj << ' ';
        ~~~~~~~~~ ^  ~~~
/usr/include/c++/v1/ostream:818:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, char __c)
^
/usr/include/c++/v1/ostream:778:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, _CharT __c)
^
/usr/include/c++/v1/ostream:785:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn)
^
source_file.cpp:22:15: note: candidate function [with Container = char]
std::ostream& operator <<(std::ostream& os, const Container& objs)
              ^
/usr/include/c++/v1/ostream:198:20: note: candidate function
    basic_ostream& operator<<(int __n);
                   ^
/usr/include/c++/v1/ostream:195:20: note: candidate function
    basic_ostream& operator<<(bool __n);
                   ^
/usr/include/c++/v1/ostream:196:20: note: candidate function
    basic_ostream& operator<<(short __n);
                   ^
/usr/include/c++/v1/ostream:197:20: note: candidate function
    basic_ostream& operator<<(unsigned short __n);
                   ^
/usr/include/c++/v1/ostream:199:20: note: candidate function
    basic_ostream& operator<<(unsigned int __n);
                   ^
/usr/include/c++/v1/ostream:200:20: note: candidate function
    basic_ostream& operator<<(long __n);
                   ^
/usr/include/c++/v1/ostream:201:20: note: candidate function
    basic_ostream& operator<<(unsigned long __n);
                   ^
/usr/include/c++/v1/ostream:202:20: note: candidate function
    basic_ostream& operator<<(long long __n);
                   ^
/usr/include/c++/v1/ostream:203:20: note: candidate function
    basic_ostream& operator<<(unsigned long long __n);
                   ^
/usr/include/c++/v1/ostream:204:20: note: candidate function
    basic_ostream& operator<<(float __f);
                   ^
/usr/include/c++/v1/ostream:205:20: note: candidate function
    basic_ostream& operator<<(double __f);
                   ^
/usr/include/c++/v1/ostream:206:20: note: candidate function
    basic_ostream& operator<<(long double __f);
                   ^
/usr/include/c++/v1/ostream:825:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, signed char __c)
^
/usr/include/c++/v1/ostream:832:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, unsigned char __c)
^
source_file.cpp:24:8: error: use of overloaded operator '<<' is ambiguous (with operand types 'std::ostream' (aka 'basic_ostream<char>') and 'const char [123]')
    os << __PRETTY_FUNCTION__ << '\n';
    ~~ ^  ~~~~~~~~~~~~~~~~~~~
source_file.cpp:37:15: note: in instantiation of function template specialization 'operator<<<std::__1::list<char, std::__1::allocator<char> > >' requested here
    std::cout << lc << '\n';
              ^
/usr/include/c++/v1/ostream:892:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, const char* __str)
^
/usr/include/c++/v1/ostream:839:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, const _CharT* __str)
^
/usr/include/c++/v1/ostream:846:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn)
^
source_file.cpp:22:15: note: candidate function [with Container = char [123]]
std::ostream& operator <<(std::ostream& os, const Container& objs)
              ^
/usr/include/c++/v1/ostream:207:20: note: candidate function
    basic_ostream& operator<<(const void* __p);
                   ^
/usr/include/c++/v1/ostream:195:20: note: candidate function
    basic_ostream& operator<<(bool __n);
                   ^
source_file.cpp:26:12: error: use of overloaded operator '<<' is ambiguous (with operand types 'std::ostream' (aka 'basic_ostream<char>') and 'const char')
        os << obj << ' ';
        ~~ ^  ~~~
/usr/include/c++/v1/ostream:818:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, char __c)
^
/usr/include/c++/v1/ostream:778:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, _CharT __c)
^
/usr/include/c++/v1/ostream:785:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn)
^
source_file.cpp:22:15: note: candidate function [with Container = char]
std::ostream& operator <<(std::ostream& os, const Container& objs)
              ^
/usr/include/c++/v1/ostream:198:20: note: candidate function
    basic_ostream& operator<<(int __n);
                   ^
/usr/include/c++/v1/ostream:195:20: note: candidate function
    basic_ostream& operator<<(bool __n);
                   ^
/usr/include/c++/v1/ostream:196:20: note: candidate function
    basic_ostream& operator<<(short __n);
                   ^
/usr/include/c++/v1/ostream:197:20: note: candidate function
    basic_ostream& operator<<(unsigned short __n);
                   ^
/usr/include/c++/v1/ostream:199:20: note: candidate function
    basic_ostream& operator<<(unsigned int __n);
                   ^
/usr/include/c++/v1/ostream:200:20: note: candidate function
    basic_ostream& operator<<(long __n);
                   ^
/usr/include/c++/v1/ostream:201:20: note: candidate function
    basic_ostream& operator<<(unsigned long __n);
                   ^
/usr/include/c++/v1/ostream:202:20: note: candidate function
    basic_ostream& operator<<(long long __n);
                   ^
/usr/include/c++/v1/ostream:203:20: note: candidate function
    basic_ostream& operator<<(unsigned long long __n);
                   ^
/usr/include/c++/v1/ostream:204:20: note: candidate function
    basic_ostream& operator<<(float __f);
                   ^
/usr/include/c++/v1/ostream:205:20: note: candidate function
    basic_ostream& operator<<(double __f);
                   ^
/usr/include/c++/v1/ostream:206:20: note: candidate function
    basic_ostream& operator<<(long double __f);
                   ^
/usr/include/c++/v1/ostream:825:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, signed char __c)
^
/usr/include/c++/v1/ostream:832:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, unsigned char __c)
^
source_file.cpp:24:8: error: use of overloaded operator '<<' is ambiguous (with operand types 'std::ostream' (aka 'basic_ostream<char>') and 'const char [122]')
    os << __PRETTY_FUNCTION__ << '\n';
    ~~ ^  ~~~~~~~~~~~~~~~~~~~
source_file.cpp:40:15: note: in instantiation of function template specialization 'operator<<<std::__1::deque<int, std::__1::allocator<int> > >' requested here
    std::cout << di << '\n';
              ^
/usr/include/c++/v1/ostream:892:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, const char* __str)
^
/usr/include/c++/v1/ostream:839:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, const _CharT* __str)
^
/usr/include/c++/v1/ostream:846:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn)
^
source_file.cpp:22:15: note: candidate function [with Container = char [122]]
std::ostream& operator <<(std::ostream& os, const Container& objs)
              ^
/usr/include/c++/v1/ostream:207:20: note: candidate function
    basic_ostream& operator<<(const void* __p);
                   ^
/usr/include/c++/v1/ostream:195:20: note: candidate function
    basic_ostream& operator<<(bool __n);
                   ^
source_file.cpp:26:19: error: use of overloaded operator '<<' is ambiguous (with operand types 'std::__1::basic_ostream<char>' and 'char')
        os << obj << ' ';
        ~~~~~~~~~ ^  ~~~
/usr/include/c++/v1/ostream:818:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, char __c)
^
/usr/include/c++/v1/ostream:778:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, _CharT __c)
^
/usr/include/c++/v1/ostream:785:1: note: candidate function [with _CharT = char, _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn)
^
source_file.cpp:22:15: note: candidate function [with Container = char]
std::ostream& operator <<(std::ostream& os, const Container& objs)
              ^
/usr/include/c++/v1/ostream:198:20: note: candidate function
    basic_ostream& operator<<(int __n);
                   ^
/usr/include/c++/v1/ostream:195:20: note: candidate function
    basic_ostream& operator<<(bool __n);
                   ^
/usr/include/c++/v1/ostream:196:20: note: candidate function
    basic_ostream& operator<<(short __n);
                   ^
/usr/include/c++/v1/ostream:197:20: note: candidate function
    basic_ostream& operator<<(unsigned short __n);
                   ^
/usr/include/c++/v1/ostream:199:20: note: candidate function
    basic_ostream& operator<<(unsigned int __n);
                   ^
/usr/include/c++/v1/ostream:200:20: note: candidate function
    basic_ostream& operator<<(long __n);
                   ^
/usr/include/c++/v1/ostream:201:20: note: candidate function
    basic_ostream& operator<<(unsigned long __n);
                   ^
/usr/include/c++/v1/ostream:202:20: note: candidate function
    basic_ostream& operator<<(long long __n);
                   ^
/usr/include/c++/v1/ostream:203:20: note: candidate function
    basic_ostream& operator<<(unsigned long long __n);
                   ^
/usr/include/c++/v1/ostream:204:20: note: candidate function
    basic_ostream& operator<<(float __f);
                   ^
/usr/include/c++/v1/ostream:205:20: note: candidate function
    basic_ostream& operator<<(double __f);
                   ^
/usr/include/c++/v1/ostream:206:20: note: candidate function
    basic_ostream& operator<<(long double __f);
                   ^
/usr/include/c++/v1/ostream:825:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, signed char __c)
^
/usr/include/c++/v1/ostream:832:1: note: candidate function [with _Traits = std::__1::char_traits<char>]
operator<<(basic_ostream<char, _Traits>& __os, unsigned char __c)
^
9 errors generated.