Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 7 years ago

Language

C++

Compiler

gcc HEAD 9.0.1 20190221 (experimental)

Options
Warnings
Boost 1.69.0
C++2a(GNU)
no pedantic

Author

anonymous

almost 7 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.69.0/gcc-head/include -std=gnu++2a
prog.cc: In function 'std::string to_string(std::string, int, int)':
prog.cc:8:202: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 | template <typename T, size_t N> int SIZE(const T (&t)[N]){ return N; } template<typename T> int SIZE(const T &t){ return t.size(); } string to_string(string s, int x1=0, int x2=1e9){ return '"' + ((x1 < s.size()) ? s.substr(x1, x2-x1+1) : "") + '"'; } string to_string(const char* s) { return to_string((string) s); } string to_string(bool b) { return (b ? "true" : "false"); } string to_string(char c){ return string({c}); } template<size_t N> string to_string(bitset<N> &b, int x1=0, int x2=1e9){ string t = ((x1 < b.size()) ? (b.to_string()).substr(x1, x2-x1+1) : ""); reverse(begin(t), end(t)); return '"' + t + '"'; } template <typename A, typename... C> string to_string(A (&v), int x1=0, int x2=1e9, C... coords); int l_v_l_v_l = 0, t_a_b_s = 0; template <typename A, typename B> string to_string(pair<A, B> &p) { l_v_l_v_l++; string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; l_v_l_v_l--; return res; } template <typename A, typename... C> string to_string(A (&v), int x1, int x2, C... coords) { int rnk = rank<A>::value; string tab(t_a_b_s, ' '); string res = ""; bool first = true; if(l_v_l_v_l == 0) res += nl; res += tab + "["; x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v)); auto l = begin(v); advance(l, x1); auto r = l; advance(r, (x2-x1) + (x2 < SIZE(v))); for (auto e = l; e != r; e = next(e)) { if (!first) { res += ", "; } first = false; l_v_l_v_l++; if(e != l){ if(rnk > 1) { res += nl; t_a_b_s = l_v_l_v_l; }; } else{ t_a_b_s = 0; } res += to_string(*e, coords...); l_v_l_v_l--; } res += "]"; return res; }
      |                                                                                                                                                                                                       ~~~^~~~~~~~~~
prog.cc: In instantiation of 'std::string to_string(std::bitset<_Nb>&, int, int) [with long unsigned int N = 4; std::string = std::__cxx11::basic_string<char>]':
prog.cc:204:27:   required from here
prog.cc:8:516: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare]
    8 | template <typename T, size_t N> int SIZE(const T (&t)[N]){ return N; } template<typename T> int SIZE(const T &t){ return t.size(); } string to_string(string s, int x1=0, int x2=1e9){ return '"' + ((x1 < s.size()) ? s.substr(x1, x2-x1+1) : "") + '"'; } string to_string(const char* s) { return to_string((string) s); } string to_string(bool b) { return (b ? "true" : "false"); } string to_string(char c){ return string({c}); } template<size_t N> string to_string(bitset<N> &b, int x1=0, int x2=1e9){ string t = ((x1 < b.size()) ? (b.to_string()).substr(x1, x2-x1+1) : ""); reverse(begin(t), end(t)); return '"' + t + '"'; } template <typename A, typename... C> string to_string(A (&v), int x1=0, int x2=1e9, C... coords); int l_v_l_v_l = 0, t_a_b_s = 0; template <typename A, typename B> string to_string(pair<A, B> &p) { l_v_l_v_l++; string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; l_v_l_v_l--; return res; } template <typename A, typename... C> string to_string(A (&v), int x1, int x2, C... coords) { int rnk = rank<A>::value; string tab(t_a_b_s, ' '); string res = ""; bool first = true; if(l_v_l_v_l == 0) res += nl; res += tab + "["; x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v)); auto l = begin(v); advance(l, x1); auto r = l; advance(r, (x2-x1) + (x2 < SIZE(v))); for (auto e = l; e != r; e = next(e)) { if (!first) { res += ", "; } first = false; l_v_l_v_l++; if(e != l){ if(rnk > 1) { res += nl; t_a_b_s = l_v_l_v_l; }; } else{ t_a_b_s = 0; } res += to_string(*e, coords...); l_v_l_v_l--; } res += "]"; return res; }
      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ~~~~^~~~~~~~~~~
prog.cc: In instantiation of 'std::string to_string(std::bitset<_Nb>&, int, int) [with long unsigned int N = 6; std::string = std::__cxx11::basic_string<char>]':
prog.cc:217:5:   required from here
prog.cc:8:516: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare]
prog.cc: In instantiation of 'int SIZE(const T (&)[N]) [with T = char [5]; long unsigned int N = 2]':
prog.cc:8:1182:   required from 'std::string to_string(A&, int, int, C ...) [with A = char [2][5]; C = {}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:138:5:   required from here
prog.cc:8:52: warning: unused parameter 't' [-Wunused-parameter]
    8 | template <typename T, size_t N> int SIZE(const T (&t)[N]){ return N; } template<typename T> int SIZE(const T &t){ return t.size(); } string to_string(string s, int x1=0, int x2=1e9){ return '"' + ((x1 < s.size()) ? s.substr(x1, x2-x1+1) : "") + '"'; } string to_string(const char* s) { return to_string((string) s); } string to_string(bool b) { return (b ? "true" : "false"); } string to_string(char c){ return string({c}); } template<size_t N> string to_string(bitset<N> &b, int x1=0, int x2=1e9){ string t = ((x1 < b.size()) ? (b.to_string()).substr(x1, x2-x1+1) : ""); reverse(begin(t), end(t)); return '"' + t + '"'; } template <typename A, typename... C> string to_string(A (&v), int x1=0, int x2=1e9, C... coords); int l_v_l_v_l = 0, t_a_b_s = 0; template <typename A, typename B> string to_string(pair<A, B> &p) { l_v_l_v_l++; string res = "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; l_v_l_v_l--; return res; } template <typename A, typename... C> string to_string(A (&v), int x1, int x2, C... coords) { int rnk = rank<A>::value; string tab(t_a_b_s, ' '); string res = ""; bool first = true; if(l_v_l_v_l == 0) res += nl; res += tab + "["; x1 = min(x1, SIZE(v)), x2 = min(x2, SIZE(v)); auto l = begin(v); advance(l, x1); auto r = l; advance(r, (x2-x1) + (x2 < SIZE(v))); for (auto e = l; e != r; e = next(e)) { if (!first) { res += ", "; } first = false; l_v_l_v_l++; if(e != l){ if(rnk > 1) { res += nl; t_a_b_s = l_v_l_v_l; }; } else{ t_a_b_s = 0; } res += to_string(*e, coords...); l_v_l_v_l--; } res += "]"; return res; }
      |                                          ~~~~~~~~~~^~~~~
prog.cc: In instantiation of 'int SIZE(const T (&)[N]) [with T = char; long unsigned int N = 5]':
prog.cc:8:1182:   required from 'std::string to_string(A&, int, int, C ...) [with A = char [5]; C = {}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:141:16:   required from here
prog.cc:8:52: warning: unused parameter 't' [-Wunused-parameter]
prog.cc: In instantiation of 'int SIZE(const T (&)[N]) [with T = std::__cxx11::basic_string<char> [2]; long unsigned int N = 2]':
prog.cc:8:1182:   required from 'std::string to_string(A&, int, int, C ...) [with A = std::__cxx11::basic_string<char> [2][2]; C = {}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:145:5:   required from here
prog.cc:8:52: warning: unused parameter 't' [-Wunused-parameter]
prog.cc: In instantiation of 'int SIZE(const T (&)[N]) [with T = int [2][3]; long unsigned int N = 2]':
prog.cc:8:1182:   required from 'std::string to_string(A&, int, int, C ...) [with A = int [2][2][3]; C = {}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:160:5:   required from here
prog.cc:8:52: warning: unused parameter 't' [-Wunused-parameter]
prog.cc: In instantiation of 'int SIZE(const T (&)[N]) [with T = std::vector<int> [2]; long unsigned int N = 2]':
prog.cc:8:1182:   required from 'std::string to_string(A&, int, int, C ...) [with A = std::vector<int> [2][2]; C = {}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:167:5:   required from here
prog.cc:8:52: warning: unused parameter 't' [-Wunused-parameter]
prog.cc: In instantiation of 'int SIZE(const T (&)[N]) [with T = std::bitset<4> [2]; long unsigned int N = 4]':
prog.cc:8:1182:   required from 'std::string to_string(A&, int, int, C ...) [with A = std::bitset<4> [4][2]; C = {}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:199:5:   required from here
prog.cc:8:52: warning: unused parameter 't' [-Wunused-parameter]
prog.cc: In instantiation of 'int SIZE(const T (&)[N]) [with T = std::__cxx11::basic_string<char>; long unsigned int N = 2]':
prog.cc:8:1182:   required from 'std::string to_string(A&, int, int, C ...) [with A = std::__cxx11::basic_string<char> [2]; C = {}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:8:1493:   required from 'std::string to_string(A&, int, int, C ...) [with A = std::__cxx11::basic_string<char> [2][2]; C = {}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:145:5:   required from here
prog.cc:8:52: warning: unused parameter 't' [-Wunused-parameter]
prog.cc: In instantiation of 'int SIZE(const T (&)[N]) [with T = int [3]; long unsigned int N = 2]':
prog.cc:8:1182:   required from 'std::string to_string(A&, int, int, C ...) [with A = int [2][3]; C = {}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:8:1493:   required from 'std::string to_string(A&, int, int, C ...) [with A = int [2][2][3]; C = {}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:160:5:   required from here
prog.cc:8:52: warning: unused parameter 't' [-Wunused-parameter]
prog.cc: In instantiation of 'int SIZE(const T (&)[N]) [with T = std::vector<int>; long unsigned int N = 2]':
prog.cc:8:1182:   required from 'std::string to_string(A&, int, int, C ...) [with A = std::vector<int> [2]; C = {}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:8:1493:   required from 'std::string to_string(A&, int, int, C ...) [with A = std::vector<int> [2][2]; C = {}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:167:5:   required from here
prog.cc:8:52: warning: unused parameter 't' [-Wunused-parameter]
prog.cc: In instantiation of 'int SIZE(const T (&)[N]) [with T = std::bitset<4>; long unsigned int N = 2]':
prog.cc:8:1182:   required from 'std::string to_string(A&, int, int, C ...) [with A = std::bitset<4> [2]; C = {}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:8:1493:   required from 'std::string to_string(A&, int, int, C ...) [with A = std::bitset<4> [4][2]; C = {}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:199:5:   required from here
prog.cc:8:52: warning: unused parameter 't' [-Wunused-parameter]
prog.cc: In instantiation of 'int SIZE(const T (&)[N]) [with T = int; long unsigned int N = 3]':
prog.cc:8:1493:   recursively required from 'std::string to_string(A&, int, int, C ...) [with A = int [2][3]; C = {}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:8:1493:   required from 'std::string to_string(A&, int, int, C ...) [with A = int [2][2][3]; C = {}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:160:5:   required from here
prog.cc:8:52: warning: unused parameter 't' [-Wunused-parameter]
[a]: 
[([1, 2], ["gandalf", "the", "grey"]), ([3, 4], ["sauron"]), ([5], ["frodo", "bilbo"])]

[a,0,1]: 
[([1, 2], ["gandalf", "the", "grey"]), ([3, 4], ["sauron"])]

[a,5,5]: 
[]


[([1, 2], ["gandalf", "the", "grey"]), ([3, 4], ["sauron"])]
[b]: 
[(1, [(2, 3)]), (4, [(5, 6), (7, 8)]), (9, [(10, 11)])]

[b,0,0]: 
[(1, [(2, 3)])]

[c]: (2, "twin")

[c.second]: "twin"

[d]: 
[["how", "r"], ["u"]]

[d,0,1,0,0,0,1]: 
[["ho"], ["u"]]

[e]: 
["fated", "faithful", "fatal"]

[e,0,2,3,4]: 
["ed", "th", "al"]

[f]: 
[[t, r, i, c, k], 
 [f, r, e, e, e]]

[f,0,10,1,3]: 
[[r, i, c], 
 [r, e, e]]

[t, r, i, c, k]
[f, r, e, e, e]

[g]: 
[["file", "input"], 
 ["file", "output"]]

[g,0,1,0,1,0,1]: 
[["fi", "in"], 
 ["fi", "ou"]]

[h]: 
[1, 2, 3, 4, 5]

[h,2,3]: 
[3, 4]

[i]: 
[9, 10, 11, 12]

[i,2,3]: 
[11, 12]

[j]: 
[[[4, 5, 6], 
  [10, 11, 12]], 
 [[1, 2, 3], 
  [7, 8, 9]]]

[j,0,0,0,1,0,1]: 
[[[4, 5], 
  [10, 11]]]

[[[4, 5], 
  [10, 11]]]

[k]: 
[[[1, 2, 3], [4, 5]], 
 [[6, 7, 8], [9, 10]]]

[k,0,1,0,3,0,0]: 
[[[1], [4]], 
 [[6], [9]]]

[[[1, 2, 3], [4, 5]], 
 [[6, 7, 8], [9, 10]]]

[l]: 
[(1, (2, 3)), (4, (5, 6)), (7, (8, 9))]

[l,0,1]: 
[(1, (2, 3)), (4, (5, 6))]

[(1, (2, 3)), (4, (5, 6))]

[m]: (1, [2, 3, 4])

[n,0]: 
[3.141593, 2.718280]

[o,1]: 
[834759385742, 22847598, 304895]

[p]: 
[["0010", "1010"], 
 ["0110", "1110"], 
 ["0010", "1010"], 
 ["0110", "1110"]]

[p,1,3]: 
[["0110", "1110"], 
 ["0010", "1010"], 
 ["0110", "1110"]]

[["0110", "1110"], 
 ["0010", "1010"], 
 ["0110", "1110"]]

[["0010", "1010"], 
 ["0110", "1110"], 
 ["0010", "1010"], 
 ["0110", "1110"]]

"0010"
"1010"
"0110"
"1110"
"0010"
"1010"

[q]: 
["0011", "1011", "0111", "1111"]

[q,1,2,0,2]: 
["011", "111"]

[q,5,5,0,2]: 
[]

["0011", "1011", "0111", "1111"]

["0011", "1011", "0111", "1111"]
["0011", "1011", "0111", "1111"]
["0011", "1011", "0111", "1111"]

[r]: "100110"
[r,0,4]: "00110"
[r,20,1]: ""
"00110"
[s,20,1]: ""
[t]: 5
[u]: R
[v]: ((234.345340, 42), (133, "IOI"))
5 R ((234.345340, 42), (133, "IOI"))
Exit Code:
0