« first day (410 days earlier)      last day (4539 days later) » 

cpx
12:03 PM
oh great.
I need to compile boost library for VC++10, took 10 hours last time :/
 
should only take a couple of hours on a reasonable machine
 
sbi
@TheRarebit See The Three Basic Rules of Operator Overloading in C++. Your idea violates #1 and #2.
 
@cpx 10 hours? What prehistoric machine are you compiling on?
 
@sbi cheers, good explanation as to why I shouldn't ave gone on with that idea
lucky I backed out when I did :)
 
 
cpx
12:10 PM
Maybe because I was gaming while it was working in background :s but this time I plan to leave it overnight :)
 
I would never consider vector += 1,2,3 to be anything other than append.
Also Boost.Assign defines += for containers.
 
@CatPlusPlus I would consider it to be messed up, and when I encounter messed up code, the first thing I do is give up on the assumption that the author was sane. And if you can't assume a sane author, then the code might do anything
 
@CatPlusPlus yes, but Boost defines Spirit too. Not everything Boost does is sane
 
Spirit is wonderful.
 
12:13 PM
Spirits are wonderful
 
I've overloaded += for a shader program to add a sequence of shaders.
It shortens the code, and if you ever used a high-level dynamic language, then you're already used to + being well-defined for sequences and such.
 
sbi
> According to some, abusing + for string concatenation is a violation, but it has by now become well established praxis, so that it seems natural. [...] putting it into the std lib basically set this in stone. The same goes for abusing << and >> for IO, BTW. Why would left-shifting be the obvious output operation? Because we all learned about it when we saw our first "Hello, world!" application. And for no other reason. sbi Dec 12 '10 at 19:56
@CatPlusPlus Since when is "shorter code" a goal in itself?
 
Expressiveness is a good thing.
Also, if you define overloading operator + for concatenation as a violation, then all overloads are a violation, unless all your classes are numbers.
 
sbi
@CatPlusPlus Since when does expressiveness correlate with "short code"?
 
12:17 PM
@CatPlusPlus Point of confusion: std::valarray::operator+
 
As long as it's documented, it's fine.
 
sbi
@CatPlusPlus Yes, it is if you or I invent it. Since it's been put into streams >25 years ago, and put into the C++ std lib, it's now established praxis. It's almost the same with boost. What they do does become established praxis. What you or I do, does not become established practice, which is why you and I should stick to rule #1.
 
@CatPlusPlus well, technically, any operator overload you define can be documented. Documented != clear to the reader. It's clear to the author, and allows him to defer explanation to that documentation if someone misunderstands.
 
honestly, writing append instead of += is unlikely to slow you down significantly
 
sbi
@CatPlusPlus The best documentation for an appending function is to name it append(). Naming it operator+() and writing into its documentation that it appends is inferior.
 
12:21 PM
especially for a vector, I'd say + or += are dangerous, because a vector also has a well-known mathematical definition, in which addition certainly does not mean "append"
 
vector += 1, 2, 3, 4, 5, 6;
 
heck, you could make it so that you can do some_vec.append(5).append(6).append(7), but then again, perhaps the stream operator like Qt overloads is better suited for appending (!)
 
vector.append(1);
vector.append(2);
vector.append(3);
vector.append(4);
vector.append(5);
vector.append(6);
 
I vote for operator<< to append
 
@rubenvb Arbitrary choice, nothing else.
 
sbi
12:22 PM
@CatPlusPlus What does this do: vector += f(), g(), h(), i(), j(), k();?
 
And possibly even more confusing for those considering += to be confusing.
 
it at least has no mathematical confusion possible, unless you think in bits.
and works for all std containers that currently exist.
 
append(1,2,3,4,5,6) would be a nice way to concisely append to a vector
 
sbi
@CatPlusPlus Last time I looked, std::vector didn't support +=.
 
Boost.Assign.
 
12:25 PM
(slowly sneaks away after starting a debate) :P
 
for_range(1, 6, [&](int n) { vector.push_back(n); }); (Implementation for for_range left as an exercise :D )
 
Xeo
template<class T> AppenderProxy<T> operator+=(std::vector<T>& v, T const& val){ v.push_back(val); return AppenderProxy<T>(v);
and
 
Here be silly. I'm starting to get frightened...
 
sbi
@CatPlusPlus Yeah, I know. Everybody who's had a look into boost expect incomprehensible code to magically compile when they see an #include <boost/...> at the top of a source file.
 
Xeo
template<class T> AppenderProxy<T>& operator,(AppenderProxy<T>& p, T const& vval){ p.v.push_back(val); return p; }
 
sbi
12:27 PM
As I said, if boost does this, it's fine. If you do so, it's not.
Heck, if the STL came with overloaded operators out of the box, we'd all assume += to add an entry to a std::deque. I'm just not sure why some believe that the world would be a better place then.
 
Xeo
@sbi Why not try to establish some new conventions?
 
@Xeo Good conventions are hard to come by, unless you work at the UN, where they're called resolutions, and the amount already passed is quite stellar
 
Because only Boost and standard library can establish conventions, apparently.
 
Last I heard, Boost was open source
 
sbi
12:29 PM
@Xeo You and I and the @Cat will very likely not establish any new convention in operator overloading. All we would achieve is to produce a piece of confusing code. If you want to establish a new convention, lobby for it on the boost mailing list, fight it through, implement it, and have it accepted into boost.
 
Well, you were arguing against += for vectors and it's already in the Boost.
 
@sbi +1 (damn where's those arrows when you need 'm)
 
Xeo
@rubenvb Make it a star
 
@CatPlusPlus but it's in a library which also breaks other guidelines (like, overloading the comma operator), and which isn't widely used, and is likely to be rendered entirely superfluous with C++11 initializer lists
 
@Xeo hmm, it'll place the quote out of context, not really what I'm looking for :/)
 
sbi
12:32 PM
@CatPlusPlus No. Any lib that's used a lot can do that. I am sure that, for example, Qt has established conventions. But even they don't have the necessary market penetration power to make me sure they did. So boost and the std lib are the only two examples I can think of.
 
Xeo
@rubenvb I think @sbi's message is in context in and of itself, so no probs there
 
Boost promotes a lot of clever ideas and conventions, but not everything in Boost is a clever idea or a good convention :)
 
@Xeo There, starred it :)
 
I don't care about politics, I just want to finish my code ASAP.
 
Xeo
I wonder why there is no void vector<T>::push_back(initializer_list<T>) :s. Would solve the discussion about += for containers: vec.push_back({1,2,3,4,5,6});
 
12:33 PM
Many libraries have their own (albeit strange) conventions.
 
Equally many people will be confused by initializer list as by operator+=.
 
@CatPlusPlus What's confusing about v.push_back( {some_element, 5,7} );?
 
Xeo
It might aswell be ambigiuos too, if your value_type supports initializer_lists
So actually, it's no fix :s
 
Imagine you don't know about initializer lists.
Could you tell what this is doing?
 
Xeo
I think there's some ambiguity anyways with initializer lists and uniform initialization
 
12:39 PM
@Xeo Shouldn't the compiler disambiguate, like it does for std::map and std::pair?
ie an extra level of {} should do the trick
 
Xeo
void foo(std::initializer_list<int> l);
void foo(std::vector<int> v);
Which would be chosen by a call to foo({1,2,3,4,5});?
 
the first, I think I saw a previous question on this, or a word about it in the standard
 
I'd think first one is a better match.
 
Xeo
@CatPlusPlus Atleast it should, since std::vector<T> v{1,2,3,4,5}; afaik calls vector<T>::vector(initializer_list<T>)
so there'd be two conversions for the second overload of foo
or so I hope
still ambiguous for the reader
 
I just found a typo in n3290, anyone care to see if it's still in the final document? :p
 
12:43 PM
C++ has enough corner cases to be self-obfuscating, no point arguing about overloading operators. ;)
 
It's in 13.3.3.1.5/3, the g( {1.0, 1,0} ); // error: narrowing line, a comma instead of a period.
 
Xeo
@rubenvb Maybe it was meant as g( {1.0, 1, 0} );? :P
 
@Xeo not in this context
 
Xeo
But without that, wouldn't there not be any narrowing? I mean, {1.0, 1.0} is just a initializer_list<double>
 
@Xeo but the function it's matching is B(int, double);
or struct constructor thing
 
Xeo
12:48 PM
I'm confuzzled
 
a list of 3 wouldn't even make sense to pass to a constructor taking 2 args
because g is declared to take a B
so what A is doesn't play in those lines
 
Xeo
Well, don't mind me, I'm being pretty delirious thanks to my cold
Also, uniform initialization must be one hell for a compiler writer to implement. Looking all over the place to check what exactly has to be called.. ctor, ctor with init list, aggregate initialization, etc etc
 
@Xeo why not check the g++ source code <evil laugh>
 
Xeo
Yeah, like hell.
 
The Clang devs said they would be embarassed not to have initializer list stuff by 3.1 release, so wait another half year and you've got readable code :)
 
Xeo
1:10 PM
Hm. What are standard paths in linux one should know about what to put there? Like /mnt for mounted filesystems and such?
 
Filesystem Hierarchy Standard.
 
Xeo
Okay, that's what I already found
Hm. And what would be a good place to put stuff like the llvm source? oO
 
Under your home directory.
 
@Potatoswatter lol
 
Is this your first time installing something from source on Linux?
 
1:19 PM
but true
 
I never realized you can define variables inside a while loop: while (int a = foo()) { }. What's the lifetime of a?
(I knew it can be done in if blocks.)
 
Xeo
@KerrekSB The while block
 
The scope of the while statement.
 
Xeo
if(int a = 5 && false)
  ;
else
  std::cout << a;
Is nice
 
@Xeo Just once, or forever?
 
Xeo
1:22 PM
or something like that, anyways
 
It can also be done with switch, which is more useful than the others because the value isn't converted to Boolean.
 
Xeo
@KerrekSB What do you mean?
 
I.e. does it live through all rounds, or does it die and get reinitialized each round?
 
Xeo
@Potatoswatter How did you figure that out? :>
 
@Xeo "Nice" is a matter of taste :-) It's useful for checking dynamic casts...
 
1:23 PM
It's the same as while (a = foo()), only limits the scope.
 
@Potatoswatter Now that's interesting
 
It will be destroyed and reinitialized… I'll check for a reference though.
 
Why would it survive the iteration?
It doesn't really make sense.
 
cpx
while(int a = foo());
 
@Potatoswatter Oh. Hm. I guess that's not a problem. C++ is all about disposing of unneeded objects.
 
cpx
1:24 PM
is equivalent to
 
@CatPlusPlus I don't know... I thought it's like { int a; while (a = foo() { } }
 
cpx
	 lbl;
	 {
	     int a = foo();

		 if(foo()) { goto lbl; }
	 }
 
Xeo
@KerrekSB take a look at Boost.ForEach. ;)
 
@KerrekSB It is.
 
@CatPlusPlus But in my example a only gets initialized once
In @cpx's code it gets initialized in each round
 
1:25 PM
C++11 6.5.1/2: "The variable created in a condition is destroyed and created with each iteration of the loop."
 
@Potatoswatter Sweet
 
Odd they put it that way, "but not in that order."
 
Xeo
VS11 doesn't support explicit conversion operators...
 
Shocking.
 
@Xeo VS11 supports nothing new, really, only the library got fixed up, and even that is incommplete due to missing intrinsics and fubar'ed decltype
 
1:28 PM
Why did they need to release VS10 and VS11 in such short time?
Wouldn't it be better to spend some time on the development?
 
@rubenvb Wait, the keyword decltype was adopted by the Standard from MSVC, but not the semantics? What's different?
 
Xeo
if(!--i) - interesting notation.
 
@Potatoswatter it's pretty broken, especially in template parameters, where libc++ uses it
hold on
 
> You have already edited five of your own posts today. Further edits are not allowed until tomorrow.
 
1:34 PM
Well, crap. This will take forever.
 
there's more
 
Xeo
@rubenvb Oh, yeah, decltype fucks up on dependent names it seems
@Maxpm Wtf?
Oh right, @rubenvb, do you know if the SFINAE employed by __invokable in libc++ is just using a fluke of clang or if it's legal C++11 SFINAE? See here for more information.
 
@rubenvb Seems I can't load these pages :(
 
@Potatoswatter here's one, the other is too big to fit on my 1280x800 laptop screen)
 
It's OK, the problem went away now :)
 
1:40 PM
I have an email to cfe-dev, I'll look it up
@Xeo No friggin' idea. All I do when porting libc++ is plug holes :D
 
Xeo
lol, k :)
 
cpx
Does this work?
delete[] new char[42]; ?
 
@cpx Shouldn't you call delete[]?
 
cpx
Done
 
Xeo
@cpx Yes (with delete[])
 
cpx
1:45 PM
memory is allocated and deallocated in same statement?
 
@cpx Unless allocation fails, yes.
 
@cpx I hope the optimizer sees through this
although it could hide an exception being thrown. Is that legal?
 
@rubenvb No, not optimizable, nor would anyone try to write such an optimization.
 
@Potatoswatter because operator new and delete are special?
 
@rubenvb Because they're not that special… they just map to function calls, and aside from type semantics it's no different from free( malloc( 42 ) ).
 
1:50 PM
@Potatoswatter which is a no-op at the end of the day/semicolon?
 
(Well, replace free and malloc with ::operator new() and ::operator delete(), but just trying to be simple.)
@rubenvb No, it's passing the result of one extern function to another extern function.
 
I think I have an idea for a static linked list that is genuinely better than a dynamic linked list with a pool allocator:
Initialize N nodes, value nil, all linked. Maintain a head and a tail node pointer.
 
I suppose with global inline operator new and inline operator delete overrides, such optimization could happen, but they would need to be implemented simply enough for the optimizer to see through the expression's pure-functional semantics.
 
As the list grows, just pick an empty node from the linked list of empty nodes. As you delete an element, splice it onto the end of the free list.
You don't need a separate "pool"
The list is just naturally bisect into the "used" part and the "free" part.
 
pool allocation is faster than that
 
1:58 PM
@DeadMG How so? In my SLL I would only double the cost of insertion/erasure, but without any allocation at all...
 
well
you can't just dump things on the end of the free list
that would make finding them again to reallocate them O(n) in iteration of a linked list
 
The current end of the list would have its next point to the first free element
 
there's a reason that native memory allocators are more advanced than that and it's because it's bloody slow
 
Since I keep the head and tail globally, I can find tail in O(1), and thence the first free element.
 
ok
 
2:02 PM
{ node * head; node * tail; node[N]; }
something like that....
 
so basically, you just re-invented pool allocators
 
@DeadMG :-) Perhaps ?! But this is specific to the list
so the entire thing is one self-contained blob
 
that doesn't matter
 
Circular lists are well and good, but why bother? The allocations will quickly be randomized anyway. Just use LIFO, allocate the most recent deallocation.
 
pool allocators are fine for any generic T
 
2:03 PM
(or even {size_t head, size_t tail, node [N]})
@DeadMG I suppose if the performance difference is insignificant, then there's no reason to reinvent the wheel.
 
That's best for temporal locality anyway, which might matter more than spatial locality, not that FIFO likely does much for that anyway.
 
@Potatoswatter Oh, you mean appending a freed element at the end is bad for locality? We could also append it at the front...
 
well what I would say is
 
In fact, we can probably only append it at the front anyway, because we only have tail->next to give us the beginning of the free list.
 
Boost already thought about this and profiled it for a couple years
you won't do better
 
2:05 PM
@DeadMG Perhaps :-)
 
@KerrekSB Returning "stale" memory is certainly bad for temporal locality. Trying to keep things in the same order, which is presumably your intent, is not a guarantee of spatial locality, nor is spatial locality usually as important.
 
Oh, is the boost.circularbuffer a static thing?
 
2:28 PM
I added hash_combine() as an FPA. It comes up on infrequent occasions...
 
when initializing a bool value
does it default to true or false?
 
@mwmnj Neither. Its default value is indeterminate.
 
Im working with a bool array
 
Value-initialization is zero-initialization, i.e. false, but you need to value-initialize, not default-initialize.
@mwmnj Easy-peasy: std::array<bool, N> a {}; All false.
 
hm ok thanks
bool visited[row][col][dir];
This is my bool array
then I check it in a way such as this:
visited[row][col][0]==false
so dir changes from 0-3
 
2:38 PM
@mwmnj No, that's not your bool array. Your bool array is std::array<std::array<std::array<bool, row>, col>, dir>.
 
Would I set all cases of this array to false the same way as above?
 
Say typedef std::array<std::array<std::array<bool, row>, col>, dir> ArrayType;, and then ArrayType visited{}; will value-initialize everything (to false).
 
Well the array I am using needs a third index for "direction"
 
You can also do bool visited[row][col][dir] = {}; this will initialize it all to false.
 
@mwmnj It does have three dimensions. What's the problem?
visited[1][2][3] = true; No problem.
 
2:41 PM
@KerrekSB, ah didnt see the last dir sorry
@Potatoswatter, that throws an error
 
@mwmnj No it doesn't.
 
Unless you plan on actually visiting most node+direction vertices, a std::set will probably work better.
 
Also, don't use naked arrays. Use std::array.
 
mods are being a little too aggressive with deletion...
 
cpx
2:43 PM
Some people write {} as {0}, it just means first element will be explicitly initialized not the entire array.
lol
 
@mwmnj Because you were lying to us
 
@cpx … but in this instance that requires proper implementation of brace elision, which is missing from some compilers.
 
Arrays are static objects. The dimensions have to be known at compile time.
 
@KerrekSB, not intentionally >.<
 
@mwmnj What you need is a Boost.MulitArray
 
2:45 PM
ah ok
Well I know the dimentions
 
Or alternatively a flat std::deque<bool> that you access in strides, i + col * j + col * row * k. That might be easier.
 
@mwmnj today.
 
So would just doing [rowSize][colSize][dirNum]= {}; work?
 
Is that true, even in C99, that even {} is not a valid initializer for a VLA?
 
@mwmnj If you know the dimensions at compile time, then you just coded it wrong.
Make sure col and row and dir are static constants.
(constant expressions, rather)
@Potatoswatter No idea.
 
2:47 PM
I get the dimensions of row and col from a file
 
ICEs
 
@mwmnj Then you don't know them.
 
well, you must use a vector
 
Well anyway, use a std::vector< bool >… if you have a very large number of nodes, then it will improve memory efficiency by using bit-packing. Arrays with variable dimensions are a C feature that is nonstandard and not well supported in C++.
 
Go with either Boost.MultiArray or a flat dynamic array (vector or deque) accessed in strides.
 
2:48 PM
I've never used either, which would be easier to pick up?
 
@Potatoswatter Read: "not part of C++"
@mwmnj Both are easy, both conceptually and practically
 
(Im a beginner, if you haven't noticed lol)
 
@mwmnj std::vector! If you know nothing else about the C++ library, that is the place to start.
 
@DeadMG not necessarily. His code can output code, run a compiler, create a dll, and call it to return a pointer to an array of the right size.
 
Get a cup of coffee and think about it. If you go with Boost, read the docs. If you go with a flat vector, just think about it for two minutes.
 
2:49 PM
lol
 
@DeadMG epic brute force
code that writes code, to make dynamic static code.
 
Never fall into a defeatist attitude of "I'm a beginner, it's impossible for me to learn new things." All of life is about new things and we're all beginners in one way or another.
 
that still won't create a dynamically sized array on his call stack, though :P
 
@DeadMG Aha, I'm besting you again. He can pass it a function pointer, and his new dll can pass the array as an argument.
 
2:52 PM
then it would only be on the stack of the function pointer, not the function he's in right now
 
@KerrekSB It's easiest to learn new things when you are a beginner.
 
@mwmnj Sure, if you must...
 
@DeadMG Not his function right now, but recursion is an option if you want it on the stack for a second run of his function.... so you win there.
At that point, I'd have to break C++, to make it work.
 
I r teh WinRAR
 
@mwmnj This is less complicated than you might think. You just want std::vector<bool> visited(row * col * dir);.
 
2:54 PM
Hey, I still put a dynamically created static array on the call stack.
I am code wizard.
 
@Xaade congratulations
 
easier to just use alloca() though
 
Alright, and std::vector<bool> visited(row * col * dir) = {}; will initialize all cases to false?
 
and then bool is_visited = visited[ x * (row * 3) + y * 3 + dir ]; — where 3 should be a named constant not a magic number
 
@mwmnj No, just std::vector<bool> visited(row * col * dir); will already do that.
Life is simple when you use std::vector.
 
2:57 PM
In C++11, though, (and probably not with the compiler you're using) the syntax you suggest is valid. It doesn't hurt to be explicit about initialization, after all :v)
 
@Potatoswatter I'd rather say that element (i, j, k) is visited[i + j * col + k * col * dir] or something like that. You have to get the ranges right... cup of coffee, as I said.
 
@KerrekSB The proper order depends on the access pattern of the algorithm. If it changes directions often, dir should be the fastest-varying index.
 
@Potatoswatter Wait. No. Just logically the correct expression depends on what i, j and k are. Once you've understood that, you can fiddle with the direction of the strides to optimize performance.
 
But, in any case, for a large 2-dimensional array matrix, only one traversal direction can be fast.
 
E.g. in my code, k goes over rows, j over directions and i over columns, I believe.
 
3:00 PM
@KerrekSB Meh. I've done too much of this. Yes, it sounds like premature optimization, but going through the program and adjusting all the subscript calls is a major PITA… better to at least take an initial guess.
 
@Potatoswatter You would of course wrap this in some accessor function.
(I.e. Boost.MultiArray :-))
 
Perhaps, if I went back to it today, I would do it that way :v) . Anyway, we are already advising manual subscript computation, after all.
 
Hmm, so I need the stl for vectos eh?
 
@mwmnj the STL is not really a "need", it's part of C++
 
@mwmnj You need to add #include <vector>, and then the type is named std::vector<bool>.
 
3:09 PM
not for a simile maze program intended to introduce stacks :P
*simple
 
Bah, and I'm assuming you have millions of nodes here :vP
 
Before resorting to vector, You don't think there isnt a terribly ghetto work around?
for (row = 0; row < size; ++ row)
{
for (col = 0; col < size; ++ col)
{
for (dir = 0; dir < 4; ++ dir)
{
visited[row][col][dir]=false;
}
}
}
Something like that?
 
But seriously, no program is too small for std::vector. It's quite fundamental and could also be the basis of your stack. (Which should be std::stack from <stack>, by the way.)
 
lol
This stack is a linked list
 
You're assuming it's complicated because you haven't used it. But as it is, the original declaration bool visited[rowSize][colSize][dirNum] is illegal, so you could lose homework points just for that, in an ideal school.
@mwmnj And vector is dead simple. And std::stack supports both linked lists and arrays and a kind of in-between structure called a deque.
 
3:19 PM
@mwmnj You're never "resorting to vector". You're always "blessed by vector".
 
cpx
@mwmnj You could say memset(visited, 0, row*col*dir*sizeof(bool));
But real C++ programmers don't use memset :s
use std::fill instead.
 
Can anyone tell me or point me to a way to calculate the number of bits per long on an arbitrary machine/OS combination?
I'm currently doing sizeof(long)/8
 
@cpx can't he use std::vector<T>::vector(size_t n, const T& initial_value)?
for the inner vector?
 
@Joshua CHAR_BIT * sizeof(long)
 
@Joshua I think you mean sizeof(long)*8. But anyway, use #include <numeric_limits> and std::numeric_limits<long>::digits.
CHAR_BIT is a yucky C macro :vP
 
3:28 PM
@Potatoswatter std::numeric_limits<long>::digits+1, or you're forgetting the sign bit
 
Thank you
 
Ah, yes.
 
cpx
sure, or std::array even better.
 
what is the use/"selling point" of std::array anyways?
 
It supports assignment operations, it can have size zero, …
just generally more uniform with the rest of C++.
 
3:33 PM
so instead of std::vector, we should be promoting std::array as a "C++ array"
hence the name, probably :)
 
vector is the simplest full-fledged sequence container, and array is the simplest container overall, or just a very flexible aggregate type, depending how you look at it.
 
std::array can have bounds checked access
 
(array does satisfy all the Container requirements, right?)
 
it has begin and end functions
and that kind of thing
I don't think so, because it can't be resized
 
(array does satisfy all the Container requirements, right?)
 
3:36 PM
@Potatoswatter Also equality test. array<T, N> is virtually identical to tuple<T,...,T>
I.e., array can be seen as a special case of a tuple.
(But also as an array, of course.)
 
oh, shit
compiler bug and workaround fail :(
 
You can get static access via std::get<3>(arr);
Ah, another contender for the "bullshit-optimization" tag
 
std::array is listed as a sequential container in 23.1, right above vector...
 
no, it was "silly-benchmarks"
here's the hilarious thing
if I introduce a variable working around the compiler bug, VS warns me for it being unused
 
@DeadMG I think that's why they'd call it a bug :)
 
3:47 PM
^^
indeed
 
@rubenvb The organization of the sub-clauses doesn't mean much. array is not a Sequence because it doesn't support insertion or deletion, or range initialization or …
 
@Potatoswatter 23.3.1/1: The headers <array>, <deque>, <forward_list>, <list>, and <vector> define template classes that meet the requirements for sequence containers
perhaps there's a hidden sequence container defined in <array>, like a C++ easter egg, but I doubt it
 
template< typename t, typename ... init >
auto make_array( init ... && in ) -> std::array< t, sizeof ... init > {
    return { std::forward< init >( in ) ... };
}
 
your definition of Sequence isn't C++'s definition of sequence container I guess
 
@Potatoswatter Pretty sure this has been discussed before.
 
3:51 PM
@rubenvb See the C++ definition of capital-S Sequence, 23.2.3. array fails the very first requirement. It's a minefield of confusing terminology.
 
<click>.... <lifts foot a little> BOOM!
 
ok
a struct with just member variables is an aggregate, right?
 
@DeadMG Don't they have to be POD?
 
@DeadMG That's neither necessary nor sufficient, so no.
 
fuck
wtb uniform initialization
 
3:55 PM
An aggregate has all public data members, no user-defined constructors, no bases with data members, and no virtual functions, just from my memory.
 
@Potatoswatter An aggregate is an array or a class (Clause 9) with no user-provided constructors (12.1), no brace-or-equal-initializers for non-static data members (9.2), no private or protected non-static data members (Clause 11),no base classes (Clause 10), and no virtual functions (10.3).
a bit more technical :)
 
Ah. Either bases without data members are allowed for standard-layout/POD or I just totally made that up.
 
wow, 8.5.1/10 is weird
the second example that is
 
How so?
 

« first day (410 days earlier)      last day (4539 days later) »