psy4
that's why I wondered
Liam
BTW, although const std::vector<T>& prevents copy of the vector, you copy multiple times of the vector in your recursive calling.
Liam
my compiler went infinite
The stop condition is not complete.
psy4
GCC or Clang ?
Liam
if (v.empty()) return; else if (v.size() == 1) { printf and return; }
Liam
when you slice it by v.size() / 2, the left part of slice could be empty, if the original one has only one element.
Liam
but in your case, it'll never stop.
psy4
Calm down Liam, I'm not askin for help 😅
psy4
it's just a new feature(bug?) on C++17 I'm playing with
psy4
try with --std=c++14 , I dare you 😅
psy4
sorry, ++17 or above
Francisco
Let me try
Liam
it's just a new feature(bug?) on C++17 I'm playing with
It's a bug of your code, not of C++17 or some.
Liam
Just imagine an empty vector is passed to printV, what will happen?
psy4
It's a bug of your code, not of C++17 or some.
there's an error, an obvious one, now shut up for a sec 😅
Raul
Is it safe to assume if a project compiles with gcc, it will compile with Visual Studio?
Dima
Msvc can rekt it up
Raul
and vice versa?
psy4
Michealsoft Bindows has it's own shitty compiler
psy4
always self-test on every compiler releases out there
psy4
Windian Shitwerks * tm
that's a good one too, never heard b4 😅
Raul
fooking ree, what is it about Window's that will break it?
Raul
anytime I think of VS I think Windows. Because both are garbage.
Francisco
there's an error, an obvious one, now shut up for a sec 😅
One C++17 feature that is acting is template parameter deduction. When you create the new vectors without template parameter, the compiler deduces them for you. It seems that it deduces const int instead of int
psy4
that's all I wanna know
psy4
anytime I think of VS I think Windows. Because both are garbage.
VS and Notepad are the only decent things Windows ever released
Francisco
I don't really know, I'm using godbolt
psy4
don't sweat, Franc, it's just a lame joke of mine
psy4
no
also, MS Paint 😂
Francisco
not fair 😢
Okay, I think I know what's happening, and it's all because of template parameter deduction
psy4
almost there
Francisco
When you create the new vectors, the compiler deduces that the new vectors hold some iterators to int type (maybe is using initializer_list constructor?), so doing it recursively, you get iterators to iterators to iterators to ... to iterators to int
Francisco
hence, to infinity and beyond...
Basically, you deduce an infinite type
psy4
Basically, you deduce an infinite type
See, Liam, Francisco here gets it
psy4
MS office
seriously dude ?
Francisco
hence, to infinity and beyond...
And it seems that it's using the initializer_list constructor, because it never stops, so it seems that it always has 2 elements
Anonymous
Dima
Anonymous
seriously dude ?
You are a linux guy i guess
Dima
Show me one true dev who uses windows
Dima
Lmao!
psy4
I swing both sides dawg
psy4
Windows for Windows stuffs, Linux for the rest
Anonymous
Liam
See, Liam, Francisco here gets it
Fine I get it too... You meant infinite loop in compiler time not run time.
psy4
psy4
just a silly-ass joke of mine
joel
also, MS Paint 😂
.net framework
psy4
.net framework
I can tolerate C# a bit more than Java, I guess
Liam
and I believe it's a bug not a feature.
Anonymous
psy4
Well, I didn't get that.
we've all been there
psy4
because😂
it's a bit clean for my taste
joel
Java can do anything at all
joel
like cpp
joel
or py
Francisco
and I believe it's a bug not a feature.
The bug are initializer_lists, not template parameter deduction
psy4
Java can do anything at all
I ain't having another discussion about another language after spitting on C++ stdlib 😅
Liam
The bug are initializer_lists, not template parameter deduction
I prefer to say it's a bug of the combination of initializer_lists and template parameter deduction.