« first day (447 days earlier)      last day (4505 days later) » 

9:00 PM
*Speaking from my own recent experience...
 
so do I, but there is such as thing as "too much"
syntactic sugar should be reserved for things which are actually more arduous to specify as a library
there's nothing about hash maps that's more arduous than BSTs, for example
 
List and mapping comprehensions are nice.
 
I dislike them
 
Anyway, I don't know D.
 
but again, there's nothing unique about hash maps in that situation
if there was a compelling reason to specify hash maps as a language feature, then a BST equivalent would also be called for
and a trie
and many similar things
 
Xeo
9:02 PM
> sanity is just a mask.. unsigned sanity = rational | sound | healthy;
 
Clever :)
sanity = not-giving-fuck
 
Xeo
I used to love that phrase until I thought of "mask" as "bitmask". :(
 
lol
 
Now you don't like it anymore?
 
Xeo
Now it doesn't sound as nice as before xD
 
9:03 PM
@Xeo Before now you imagined that sanity meant putting on a mask of rationality, soundness and health?
I don't dislike that.
 
Xeo
No, that, bitmask sanity in the quote was added by me as I started thinking of "mask" as "bitmask"... though I have to admit, that is also a nice interpretion.
 
@DeadMG Oh, it is a type. It is denoted as Value[Key].
 
10 mins ago, by DeadMG
I meant as a template template (equivalent)
 
What's today's non-topic?
 
how do you pass Value[Key] as a template parameter when you are expecting the callee, not the caller, to provide Value and Key?
 
9:11 PM
@DeadMG Well, Walter Bright apparently thinks that if arrays are part of the language core, so should be associative arrays.
 
well, he's thick
although that fact was determinable by looking at more than just this one language feature
 
No, he's actually quite thin. Have you seen his videos?
 
heh
you know what I mean :P
there is a genuine and solid reason to include arrays and not associative arrays
 
@DeadMG What is the genuine and solid reason to include arrays?
 
simple
 
9:12 PM
If you don't like hashmaps built into the language... what's your opinion on JavaScript? :)
 
primitive array indexing is supported by hardware
associative isn't
 
Hmm. That's an interesting way to look at it.
 
@DeadMG Because it's handy and can't be done via other language features. int main() { int myarray[3]; }
 
and secondly, associative arrays are implemented on top of primitive arrays- that is, if you didn't have associative arrays but did have primitive arrays, you could implement associative arrays anyway
 
So what, lambdas aren't built into the hardware either :)
 
9:13 PM
Surely, though, we shouldn't worry about that kind of thing when designing a language unless we have a good reason.
 
i.e., the implementation of associative arrays is dependent on primitive arrays
however, the reverse is not true at all
 
You could, however, built arrays on associative arrays. See JavaScript.
 
no you can't
 
@DeadMG I'm sure there's other generic hardware features that have no correlation to C++, even where it would be handy. getting the overflow of addition, or division/modulo in one step.
 
Of course no systems language would do that, but it's possible.
 
9:14 PM
those associative arrays are just built on primitive arrays
 
Sure you can, key = int and you're done.
 
the only difference is that they're in the interpreter implementation, not visible to the user
 
Anyway, I find it strange, but also quite nice.
 
primitive arrays have different time complexities for operations than associative arrays, have hardware support, and many other restrictions
primitive arrays are a fundamental building block of all algorithms and data structures, essentially
 
Who cares about hardware support in high-level language, really?
 
9:15 PM
whereas the reverse is most definitely not true of associative arrays
those of us who like our programs to execute today instead of tomorrow
 
Right.
 
the simple fact is that associative arrays can be trivially added as a library on top of primitive arrays as a language feature
but if you did the reverse, you would lose many characteristics of primitive arrays- high performance, in-place object allocation, certain time complexities for operations
 
If implementing associative arrays is so easy, how come C++ didn't have them before 2005 or something? :)
 
std::map has been in since 1998
 
@MooingDuck I believe it is escape
 
9:18 PM
and they only didn't add unordered_map to the Standard (it was in the SGI STL) because they felt that the Standard library had become too big
 
map is not built on arrays. :P
 
@DeadMG I meant hash maps, sorry.
 
if you downloaded the SGI STL, then you did have a hash map
and both GCC and MSVC implemented them as extensions
for a long time, IIRC
 
But a standard library without hash maps? You gotta admit that's kinda strange, no?
 
9:19 PM
and you would have been able to download other implementations or roll your own
 
I'm not sure how I feel about associative arrays.
 
eeeeh
I personally would have been in favour of adding them
 
I rarely use them, true...
 
but I don't personally favour them much over BSTs
 
@FredOverflow msdn.microsoft.com/en-us/library/6x7w9f6z(v=VS.71).aspx MSVC 2003 had a hashmap, and a note that it's been moved, so it existed before that.
 
9:20 PM
@StackedCrooked Meh. No security or control.
 
@MooingDuck Yeah, they don't provide documentation for versions prior to 2003, if I recall correctly
in any case
it would have been perfectly feasible for any user who felt they were lacking to roll one
 
I think I would rather think of regular arrays as associative arrays with integer keys.
 
nah
that's too simplistic
 
PHP does, surprise surprise.
 
@CatPlusPlus I don't care. There's plenty of scenarios where this can be very useful. Think about how dirty global variables are. Now think double dirty :D
 
9:21 PM
hash maps can insert in O(1), regular arrays are O(n)
 
@CatPlusPlus so does Lua.
 
just to name one difference
 
@StackedCrooked I can't think of one.
 
@MooingDuck Lua sucks
 
I think the std::hash thing could have used more ironing.
4
Q: Are there no specializations of std::hash for standard containers?

FredOverflowI just found myself a little bit surprised being unable to simply use a std::unordered_set<std::array<int, 16> > test; because there does not seem to be a std::hash specialization for std::arrays. Why is that? Or did I simply not find it? If there is indeed none, can the following ...

 
9:22 PM
@DeadMG I like it as a scripting language, not as an applicatoin language
@FredOverflow I know I've answered that before, that's a duplicate
 
regular arrays are contiguously stored random access, and associative arrays are non-contiguously-stored bidirectional access
 
@DeadMG What do you mean by "bidirectional access?"
 
@CatPlusPlus You can use it to implement some sort of poor-man's Google analytics.
Whatever.
 
@MooingDuck link or didn't happen
 
@Maxpm It means that you cannot jump to an arbitrary element given an iterator into an associative array, only the next or the previous
which fundamentally restricts the algorithms that you can operate upon them
 
9:24 PM
@CatPlusPlus It has similar use cases as HTML5's localStorage.
But on a more global level.
 
@FredOverflow ah the question I recall was about hashing tuple specifically. It's not quite a duplicate
1
A: Generic hash for tuples in unordered_map / unordered_set

Mooing DuckIn my C++0x draft, 20.8.15 says hash is specialized for built-in types (including pointers, but doesn't seem to imply dereferencing them). It also appears to be specialized for error_code, bitset<N>, unique_ptr<T, D>, shared_ptr<T>, typeindex, string, u16string, u32string, wstr...

 
@StackedCrooked You're fucking kidding me, right
 
@sehe Yes, haha :D
 
So it's 'like local storage', only, not local? Hahaha
 
I got you :D
 
9:25 PM
@FredOverflow My version of the standard says there's a std::hash specialization for std::vector<bool>.
 
@DeadMG I didn't think that applied to hash maps.
 
they are only bidirectional access
primitive arrays, however, are random access
 
Just a shame that went on two lines. I'd have starred a beautiful selfconflicted line like that
 
@DeadMG I'm confused. Don't you do int value = myHash["key"]? (The syntax varies from language to language, but you get the point.) Or am I thinking of something else?
 
@StackedCrooked Still, no security.
 
9:27 PM
that's not the same thing
that's accessing any element in O(1) given the map structure and the key it corresponds to
 
@CatPlusPlus my thought to. Using SSL is nice for 'obscuring' which keys are being accessed from the 'foreign' network (ie. can't be sniffed easly) but it is completely useless for the script kiddie who likes to tamper with the app state
 
@CatPlusPlus Indeed, no security. So you can only use it when security isn't crucial.
 
random access iteration means "Given the first element, find the nth element, regardless of it's key"
 
Ah.
 
@StackedCrooked Which is when?
 
9:29 PM
More like boost::hash_combine, hash_range(begin(),end())
 
But hash maps are merely implementations of associative arrays. Regular arrays can be thought of as associative arrays with integer keys and be implemented traditionally.
 
@CatPlusPlus when you're are busy losing your job, e.g.
 
@sehe Lol.
 
@Maxpm No.
a hash map is a generalization of a native array- a native array is not a specialization of a hash map
that's the way I like to think of it, anyway
 
@CatPlusPlus In my Google Chrome Extension there's no need for security. For example I am considering to add some way for people to post a mapping of a Wikipedia anime page and it's corresponding page on myanimelist.com. There is no private data.
 
9:32 PM
integer keys are special
 
Hmm.
 
and it's not just "integer keys"
it's contiguous integer keys
from 0 to N
 
Can i create something like "header for header file"? In one of my classes I've got which take as an argument another class, that is wrote few hundreds lines below.
 
@StackedCrooked And then the service shuts down and goodbye data? :P
 
@gogowitczak sure, why not? The preprocessor doesn't care
 
9:33 PM
I;ve got a function*
 
and finally, since many algorithms use integers, e.g. random access
nth element? n is an integer
 
Are regular arrays so fundamental that they cannot be implemented only in the standard library, i.e. not as a built-in language feature?
 
@CatPlusPlus Yes. I'm still in the brainstorming phase.
 
yes
if you don't have regular arrays, you cannot implement anything except linked lists, effectively
 
@StackedCrooked that myth again. There might not be a privacy issue, but a security issue nonetheless. That, and plugins have been proven to be consistently over-priviliged. So, there is subvertible applogic there. Googling a link
 
9:35 PM
If you have FFI, you don't need arrays at language level, you can implement them in another language and expose as a library.
 
@Maxpm yes
 
no, that would be foreign type interface
 
@mo
 
@gogowitczak that's usually known as ... a header file
 
else you could only implement heap-based arrays
 
9:35 PM
@DeadMG Could you not have a new operator (or function) that returns a contiguous stretch of memory, then use pointer arithmetic to access elements like an array?
 
@gogowitczak Or perhaps you are looking for template classes
 
That's pretty much what arrays are, anyway.
 
Yeah, I know - now I've fixed my problem
 
how is that any different to implementing native arrays?
 
@Maxpm you cannot have stack allocated arrays in that case
 
9:36 PM
native arrays are pointer arithmetic
 
Heap, stack, whatever.
 
thx for your help!
 
so you've said "Let's implement native arrays by pointer arithmetic!"
well, duh, that's what they are
 
Very high-level languages tend to have managed heaps, anyway. No difference there.
 
@sehe My extension doesn't ask for full access to all websites and cookies (unlike most extensions). Only to wikipedia and myanimelist.net. And yes, there may be a risk in using my app that I'm unaware of. Use at your own risk!
 
9:36 PM
@MooingDuck Hmm, good point.
 
Anyway, I'm almost out of food.
 
and secondly
 
Now that's bad.
 
@Maxpm actually, even that can be done via pointer arithmetic if you're crafty
@DeadMG which makes C++ arrays merely syntactic sugar, except for passing them by reference to a function, and a few other oddball cases.
 
"implement them as another language" doesn't really count, IMO
@MooingDuck No, because there is no non-sugar
 
9:38 PM
@DeadMG I can't think of anything you can do with an array that I can't do without one
 
i.e., if you were to try to implement your own native arrays, you would effectively have to manually add a variable for every element of the array and make a giant-ass switch-case for every access
 
@DeadMG not with template metamagic
 
you can't ask the compiler for in-place memory
@MooingDuck Even template metamagic cannot solve this one, as far as I know
you'd be depending on the compiler to optimize from O(n) lookup to O(1) lookup
 
template<class type, int size> array { type left; array<type, size-1>;}; template<class type> array<1> array { type right;};, then use pointer arithmetic
 
and not insert space between variables, and other such things
that's UB
 
9:40 PM
@DeadMG not with appropriate functions
 
the compiler has no obligation to lay out your variables in the correct order
 
@DeadMG sure it does, it can only mess with padding.
 
Xeo
@MooingDuck Hi std::tuple!
 
@Xeo oh, er. yes
 
right, so it can add arbitrary padding between the elements of type
 
9:42 PM
@DeadMG just like an array
 
if you ask for a 3-element array of type, it might randomly decide to add 8 bytes of padding between the 2nd and 3rd element
 
@StackedCrooked fair enough
 
you cannot go from multiple member variables to pointer arithmetic over those variables as if they were an array without invoking UB
 
Xeo
@MooingDuck No, an array does not have that problem. It's the type that can be padded (like a struct), but an array will be exactly of N * sizeof(T) size
 
@DeadMG darn, got me. idea incoming
 
9:44 PM
and your only option for run-time element access would be to use a recursive function
but you'd be depending upon the compiler to optimize it from O(n) to O(1)
if it decided not to, you would be screwed
 
0
A: Is there a standard C++ equivalent of IEnumerable<T> in C#?

FredOverflowThe standard C++ way is to pass two iterators: template<typename ForwardIterator> void some_function(ForwardIterator begin, ForwardIterator end) { for (; begin != end; ++begin) { do_something_with(*begin); } } Example client code: std::vector<int> vec = {2, 3, ...

proofreaders please
 
@DeadMG template <size_t I, class... Types> typename tuple_element<I, tuple<Types...> >::type& get(tuple<Types...>&) noexcept;
 
@MooingDuck run-time
 
@DeadMG It seems like a function that most compilers could trivially inline.
 
it doesn't matter what inlining you do, you can't go from a run-time variable to a template parameter
also, in my experience, compiler optimizers generally only optimize what they've been programmed to optimize and aren't good at optimizing new constructs
 
9:53 PM
AI compilers, a new research field?
 
lol
 
SO offline. What do I do?
 
porn
 
Prepare question offline.
 
I don't do questions :) .
 
9:57 PM
Then prepare answers offline. :)
 
Answers to what?
Oh wait: "what's the difference between new A and new A().
 
You obviously haven't seen the meta post about Jon Skeet...
 
That'll come up soon.
 
Answers to questions you anticipate will be asked.
 
Why doesn't sizeof(array) work inside a function?
 
9:58 PM
Or "What does const mean at the end of a member function?"
 
at least that's a nice simple answer
 
"What does && mean at the end of a member function?"
 
"vote to close as duplicate"
 
Or "Should I write int* a or int *a?"
@DeadMG Can you prepare those offline?
 
How does this work: a+++++a
 
9:59 PM
It doesn't even compile. Did you mean a++ + ++a?
 
Aiiiiiieeee OK, stop, make it stop!
 
@FredOverflow Shouldn't it compile either way?
 
@Mysticial a+++++a is parsed as ((a++)++)+a which does not compile. See "maximum munch rule".
 
@FredOverflow seems like it should. Why wouldn't it? (looking up rule...)
 
a+++++a lexes as a ++ ++ + a
 
10:00 PM
@FredOverflow ah... ok
 
@MooingDuck Because ++ expects an lvalue, but postfix ++ yields an rvalue.
 
@MooingDuck Really? How?
 
@FredOverflow alright, makes sense
 
@FredOverflow (unless overloaded)
 
Right, assuming scalars here.
 
10:01 PM
@Maxpm std::tuple was my thought, though DeadMG vehemently disagreed.
 
Overloading changes all the "sequenced before" arguments too.
 
Don't overcomplicate matters ;)
 
@MooingDuck It can't be done.
 
I didn't, that's WG22's job
 
Wanker Group 22?
 
10:02 PM
It's hilarious how all the a += a++ + ++a type questions tagged C/C++ get burned with prejudice, but tagged Java they all hit 100+...
 
Sorry SC22, WG21.
 
Really? Example link?
 
@MooingDuck How would you do it with std::tuple?
 
@CharlesBailey I was just thinking what's WG22?
 
@FredOverflow Responding to me?
 
10:03 PM
@Maxpm You can't.
 
evening all
 
I think C++ answerers have no patience for pointless repetition. Jave programmers on the other hand...
 
@Maxpm DeadMG asserts that get<index, types....>(tuple<types...) is O(n), where I believe it to be trivially inlinable to O(1).
 
an array declared like so int print_buff[64][3]; is that 3 arrays of 64 elements or the other way around?
 
no
DeadMG asserts that index is a compile time constant
and arrays are indexed at run time
did you not read WTF I said the last time you said this?
 
10:05 PM
@DeadMG Portable common tool environment working group: open-std.org/JTC1/SC22/WG22
(Not who I meant!)
 
@DeadMG I read it and thought you were completely misunderstanding me. You're correct, I hadn't' thought it through
 
@Mysticial yes
 
I believe that's what you said about the last five times we disagreed tonight :D
 
Here's the two more notorious ones I've seen:
I'm sure there are more... but they're hard to search for
79
Q: What is x after "x = x++"?

Michael Possible Duplicate: Is there a difference between x++ and ++x in java? Why does this go into an infinite loop? What happens (behind the curtains) when this is executed? int x = 7; x = x++; I compiled and executed this. x is still 7 even after the entire statement. In my book, it s...

33
Q: a = (a++) * (a++) gives strange results in Java

MariusI'm studying for the OCPJP exam, and so I have to understand every little strange detail of Java. This includes the order in which the pre- and post-increment operators apply to variables. The following code is giving me strange results: int a = 3; a = (a++) * (a++); System.out.println(a); // ...

 
211 votes for an answer? lol
 
10:07 PM
@DeadMG I've been saying that for 25 years
 
@FredOverflow I didn't do too bad either with 109...
 
Maybe I should do my rep whoring in the space?
 
SO is back. Bye.
 
I'm indecisive, should I spend time writing an IRCd (from scratch) integrating the SO chat?
 
@FredOverflow Like seriously, two sentence answers on very dumb questions can give 8+ in Java whereas in C/C++ I'd be lucky to hit 5.
 
10:10 PM
authentication of users from SO is the biggest issue, people (including myself) are paranoid
 
@Mysticial So Java is good for something after all!
 
I've been thinking about writing an extension to chrome/firefox/opera that will act as a ircd, that be kinda cool
 
Then do it.
 
@FredOverflow was that directed towards me?
 
Yes.
I advocate doing cool things.
 
10:13 PM
@FredOverflow I'm actually tempted to actually install a Java compiler just to farm rep/badges... even though I haven't used Java in like 5 years...
 
I'm trying to get the overall users opinion regarding the usability of such a plugin, @FredOverflow
 
Don't worry, Java practically hasn't changed at all in the last 5 years.
 
a 1 user ircd running natively inside the browser, using the authentication already provided by SO
it'll be quite easy to implement, and paranoid users (such as myself) got nothing to worry about
 
@FredOverflow I never got beyond the basics before I switched to C++. I think the only thing significant that came out after I quit Java was the for-each loops.
 
Yeah, the for-each loops are great.
 
10:17 PM
there's nothing non-basic about Java
 
How about threads?
 
@FredOverflow I also never learned threads before I switched to C++.
 
synchronized ... shiver
2
 
eh, threading is pretty much the same in every general-purpose language
 
I knew you'd say that :) And I disagree. volatile in Java, C# and C++ has three distinct meanings, for example.
 
10:21 PM
@DeadMG java generics wildcards are pretty funky though. they had what C# 4.0 only introduced in modest fashion: (co)variance support. However, of course, they only implemented that by 'hacking' type erase onto the 1.5 JVM
 
What's volatile doing in a conversation about threading, anyway?
 
@FredOverflow Meh. You can achieve those other meanings by other means in C++.
 
volatile is useful for threading in Java.
 
oh hey, a Badge. From a answer that wasn't really an answer. Huh.
 
There's little correlation between effort put into an answer and reputation and badges gained.
 
10:35 PM
@CharlesBailey I'd say there's a correlation normally. Answers with no effort rarely get many votes
 
@MooingDuck That's an edge case; with no effort, there is no answer. With a tiny amount of effort some answers randomly get a lot of votes.
 
@CharlesBailey fair enough
 
@CharlesBailey But once they get too long, nobody reads it... Unless there's something interesting about it...
 
user406009
There is a correlation between getting upvotes and quoting the standard though.
 
@Mysticial Yes, but people reckon they must be good and upvote them anyway, especially if the answerer has a high reputation.
 
Xeo
10:39 PM
@CharlesBailey Or if the answer already has many upvotes
 
@CharlesBailey @Xeo Very true. High rep + high votes, tl:dr = upvote...
I admit myself to doing that. I see an answer that looks right, but I'm too lazy to verify it. So I wait until it gets a few votes before I add mind.
 
Xeo
The worst thing: people usually don't bother reading the other answers if there's one with 10+ votes and just upvote that and go away.
 
@Xeo: sometimes, even when it is wrong.
 
@Xeo I wish there was an option to shuffle the answers regardless of accepted answer or votes to combat that
 
I also look to see if it picked up any downvotes before I cast an upvote without reading and verifying the entire answer.
 
Xeo
10:43 PM
Like this question. The most-voted answer has gone through so many edits until it became something good, but people just kept upvoting it because it already had so many upvotes..
 
Or this one: The old top answer has been deleted but had 35 upvotes (+ 6 downvotes) despite being demonstrably wrong: stackoverflow.com/questions/809227
 
@Xeo you're jelous :D
 
Xeo
@MooingDuck Yes. :( Because people just ignored my answer after Alexander's had gone above 12 upvotes..
 
There's much bigger fish to be jealous of. (yes I'm admitting my own jealousy)

http://stackoverflow.com/questions/8225776/why-does-sizeofx-not-increment-x
http://stackoverflow.com/questions/8640818/whats-wrong-with-this-1988-c-code
http://stackoverflow.com/questions/8710619/java-operator
 
@DeadMG one could emulate arrays by using a tuple of chars as a buffer and using an allocator/placement new to create the objects atop it with pointer arithmetic. (Obviously wrapped in a class)
 
10:51 PM
still UB
 
@DeadMG what'd I overlook this time?
 
the same as you overlooked last time
you can't go from multiple member variables to pointer arithmetic on them
 
@DeadMG I can't? I can't recall why I can't.
 
because the compiler can randomly put shit inthe middle
also, remember that many real implementations have very short limits on template code- unlike array indicies
 
@DeadMG that'd be fine since I'd be using... wait. You mean it could use the padding for something? I didn't think it could do that.
@DeadMG that I hadn't considered, but also workaround-able.
 
10:58 PM
no it in't
and the compiler can legally put whatever extras it wants into your class at any time
 
@DeadMG It's not that hard to make a template class to act as a buffer at least the size of it's parameter with no more than 28 template depth
@DeadMG well that would definitely ruin everything
 
when you make data members in a class, the only promise the compiler gives you is that they exist and that it will tell you where
 
@DeadMG that doesn't sound right, or that would mess with C-compatability of PODs.
@DeadMG I thought that they are in the order you specified
 
C compilers have the same rights
you are thinking of a platform-specific ABI
and an implementation has the right to not conform to it anytime it likes, the Standard does not define compatibility
 
@DeadMG alright
 
11:03 PM
and indeed, it could provide a platform-specific extension to define compatible classes
now, you are right in that in the general case, this doesn't usually happen
but it's not guaranteed
and there are simple examples of things where the compiler does do such things
for example, vptr storage.
 
@DeadMG I thought PODs were excluded from those things. I'll dig around in the standard, but you're usually right.
 
a native array is useless if it can only be used in POD types
 
@DeadMG the intent was to use placement new to emulate an array atop a giant POD buffer.
 
it doesn't matter what your intent was
 
sbi
I think this is a dupe. Anyone agree with me?
 
11:08 PM
the point is that native arrays do not have to be contained within POD types, and in order to stand even a hope of working, yours does
therefore, yours isn't a replacement
@sbi I expect so, but finding the original is another question
 
sbi
@DeadMG I already found one which I think it is a dupe of. I even added a comment saying so.
 
mmmm
I'm not sure I agree that they're dupes
 
sbi
@DeadMG Well, I did ask.
 
the suggested dupe just wants to get it done
the original question (dupee?) wants details about the memory management of it
 
@DeadMG I clarified the intent because this means that the array emulation would emulate an array of any type, POD or no.
 
11:11 PM
i.e., the new one says "How do I do X?" and the second one says "Why doesn't my attempt at X succeed?"
@MooingDuck Uh, the contained type isn't the problem, it's the containing type
 
sbi
@DeadMG Oh, but my answer to the one I think this is a dupe of explains all this very well. At least that's what I think. :)
 
@DeadMG I still think you're misunderstanding me. Either way, if you're right about the layout rules for POD all of this is moot anyway.
 
@sbi I agree.
@MooingDuck I'm fairly sure that the compiler can pad you for lols at any time, and that it's not OK to start messing with the paddin
ah, here's an example
array overflow in debug mode
 
@DeadMG I'm fine with padding, but I'd be hosed if the compiler read/wrote stuff to the padding
 
the compiler adds padding to the end and beginning of the array
if it doesn't have it's original value, the compiler knows you went outside the array bounds
and raises a debug assertion
canary buffers, I think they're called
 
11:23 PM
@DeadMG neat name for them
 
sure
but overwrite the canary buffer which you have no way of knowing exists and...
 
@DeadMG I'm pretty sure at this point I've given you a completely incorrect idea of what I'm thinking. I'll see if I can code it up
 
however
now that you mention it
I am inventing my own language...
 
Great, the only edible thing I have left is a lemon.
 
@CatPlusPlus no more fingers?
 
11:36 PM
EAT ALL THE LEMONS
 
does MSVC10 support alignof? It doesn't seem to
aha! __alignof
 
(there is a lot of strange things. in MSVC)
 
11:48 PM
@DeadMG ah, I understand finally, you're saying it could also put canary buffers between each of my members. Got it. I'm slow.
 
yes
 
@DeadMG ergo I can't make a buffer big enough without an array. You're right. C++ needs arrays.
I'm still wierded out that the standard requires a specialization of std::hash<vector<bool, Allocator>>, but not for other containers.
 

« first day (447 days earlier)      last day (4505 days later) »