Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 6 years ago

Language

C++

Compiler

gcc HEAD 9.0.1 20190323 (experimental)

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

Author

anonymous

over 6 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:6:202: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 | 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 = ""; for(int __iii__ = min(x1,SIZE(b)),  __jjj__ = min(x2, SIZE(b)-1); __iii__ <= __jjj__; ++__iii__){ t += b[__iii__] + '0'; } 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 += n_l; 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 += n_l; 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 += n_l; return res; } void dbgs(){;} template<typename Heads, typename... Tails> void dbgs(Heads H, Tails... T){ cout << to_string(H) << " | "; dbgs(T...); }
      |                                                                                                                                                                                                       ~~~^~~~~~~~~~
prog.cc: In instantiation of 'int SIZE(const T (&)[N]) [with T = int [2][3]; long unsigned int N = 2]':
prog.cc:6:1221:   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:114:5:   required from here
prog.cc:6:52: warning: unused parameter 't' [-Wunused-parameter]
    6 | 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 = ""; for(int __iii__ = min(x1,SIZE(b)),  __jjj__ = min(x2, SIZE(b)-1); __iii__ <= __jjj__; ++__iii__){ t += b[__iii__] + '0'; } 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 += n_l; 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 += n_l; 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 += n_l; return res; } void dbgs(){;} template<typename Heads, typename... Tails> void dbgs(Heads H, Tails... T){ cout << to_string(H) << " | "; dbgs(T...); }
      |                                          ~~~~~~~~~~^~~~~
prog.cc: In instantiation of 'int SIZE(const T (&)[N]) [with T = std::set<std::vector<std::__cxx11::basic_string<char> > >; long unsigned int N = 3]':
prog.cc:6:1221:   required from 'std::string to_string(A&, int, int, C ...) [with A = std::set<std::vector<std::__cxx11::basic_string<char> > > [3]; C = {int, int, int, int, int, int}; std::string = std::__cxx11::basic_string<char>]'
prog.cc:125:5:   required from here
prog.cc:6: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:6:1221:   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:6:1533:   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:114:5:   required from here
prog.cc:6: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:6:1533:   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:6:1533:   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:114:5:   required from here
prog.cc:6:52: warning: unused parameter 't' [-Wunused-parameter]
[j]: 
[[[4, 5, 6], 
  [10, 11, 12]], 
 [[1, 2, 3], 
  [7, 8, 9]]]

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

[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]: 
[]

[b,1,2,0,0,0,0,1,2]: 
[[["lm"]], [["uv"]]]

[b,1,2,0,0,0,0]: 
[[["klm"]], [["tuv"]]]

[b,1,2,0,0]: 
[[["klm", "nop"]], [["tuv", "wxy", "zab"]]]

[b,1,2]: 
[[["klm", "nop"], ["qrs"]], [["tuv", "wxy", "zab"]]]

[b]: 
[[["abc", "def"], ["ghi"]], [["klm", "nop"], ["qrs"]], [["tuv", "wxy", "zab"]]]

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

[c]: 
[(1, [(2, 3)]), (4, [(5, 6), (7, 8)]), (9, [(10, 11)])]

[q]: 
["0011000000", "1011000000", "0111000000", "1111000000"]

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

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

"0011000000" | 
"1011000000" | 
[m]: (1, [2, 3, 4])
[i]: 
[9, 10, 11, 12]

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

[s,20,1]: ""
[s,1,4]: "odef"
[s,t,u,v]: "codeforces" | 5 | R | ((234.345340, 42), (133, "IOI")) | 
[5.345,7,12]: 5.345000 | 7 | 12 | 
Exit Code:
0