Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 7 years ago

Language

C++

Compiler

gcc HEAD 9.0.1 20190220 (experimental)

Options
Warnings
Boost 1.69.0
C++2a(GNU)
-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 -pedantic
prog.cc: In instantiation of 'int SIZE(const T (&)[N]) [with T = char [5]; long unsigned int N = 2]':
prog.cc:8:1192:   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:119: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 '"' + 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 = (b.to_string()).substr(x1, x2-x1+1); reverse(begin(t), end(t)); return '"' + t + '"' + nl; } 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 + "["; auto l = begin(v), r = begin(v); advance(l, x1); advance(r, min(x2+1, 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 += "]"; if(l_v_l_v_l == 0) res += nl; return res; }
      |                                          ~~~~~~~~~~^~~~~
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:1192:   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:123: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:1192:   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:135: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:1192:   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:139: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 = 4]':
prog.cc:8:1192:   required from 'std::string to_string(A&, int, int, C ...) [with A = std::bitset<4> [4]; 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 = char; long unsigned int N = 5]':
prog.cc:8:1192:   required from 'std::string to_string(A&, int, int, C ...) [with A = char [5]; C = {}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:8:1395:   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:119: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:1192:   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:1395:   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:123: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:1192:   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:1395:   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:135: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:1192:   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:1395:   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:139: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:1395:   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:1395:   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:135:5:   required from here
prog.cc:8:52: warning: unused parameter 't' [-Wunused-parameter]
[a]: 
[([2,6],["getr"]),([5,4],["sert","gsdfs"]),([6],["agert","ertj"])]

[a,0,1]: 
[([2,6],["getr"]),([5,4],["sert","gsdfs"])]

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

[c]: (4,"asd")
[d]: 
[["fjs","sdf"],["sas"]]

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

[f]: 
[[a,f,u,j,r],
 [a,q,g,k,r]]

[f,0,10,1,3]: 
[[f,u,j],
 [q,g,k]]

[g]: 
[["ghdgh","5445w"],
 ["fghd","sd3535f"]]

[g,0,1,0,1,0,1]: 
[["gh","54"],
 ["fg","sd"]]

[h,0]: 
[2,4,6,7]

[h,2,3]: 
[6,7]

[i,0]: 
[6,2,63,8]

[i,2,3]: 
[63,8]

[j,0]: 
[[[4,6,2],
  [4,8,2]],
 [[1,2,3],
  [3,2,0]]]

[j,0,0,0,1,0,1]: 
[[[4,6],
  [4,8]]]

[k,0]: 
[[[1,2,3],[3,2]],
 [[1,5,3],[3,2]]]

[k,1,1,0,3]: 
[[[1,5,3],[3,2]]]

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

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

[m]: (2,[2,5,6])
[n,0]: 
[3.439847,5.739480]

[o,0]: 
[2934872934792347,238427342]

[p]: 
["1100"
,"0010"
,"0110"
,"0100"
]

[p,1,3]: 
["0010"
,"0110"
,"0100"
]

[q]: 
["1100"
,"0010"
,"0110"
,"0100"
]

[q,1,3,0,2]: 
["010"
,"110"
,"100"
]

[r]: "100110"

[r, 0, 4]: "00110"

[s,2]: "qy"
[s,2,3]: "qy"
[t]: 5
[u]: R
[v]: ((234.345340,42),(133,"IOI"))
Exit Code:
0