« first day (775 days earlier)      last day (4172 days later) » 

12:00 AM
Nov CTP didn't include defaulted functions, did it?
no
oh well
hmmm
note to self: when insert is called, do not always insert a node.
that's le dumb
 
@DeadMG §23.5.4.1/3: "void reserve(size_type n);"
 
Well, reserve is implemented.
I just step-through'd some of the library code and it changed the underlying size of the vector bucket.
 
@JerryCoffin I grepped the page for "reserve" and the only hit is "All rights reserved."
oh, you referred to the Standard
 
So really it's just ::insert itself that's being an ass at this point.
 
oh well
 
12:04 AM
lol
 
@DeadMG Grepped what page?
 
the MSDN reference
 
probably MSDN
 
I have to learn to how to write a Pool Allocator now...
Here we go!
 
@ThePhD Boost has it.
 
12:04 AM
I don't have boost.
 
then get it?
 
But a pool should be trivial, right?
 
@DeadMG Yes.
 
I wouldn't bet on it, personally
 
Well, I've never written an allocator before.
So, gotta get DAT KNOWLEDGE. (/wrist/wrist/wrist)
 
12:06 AM
fair enough
 
@ThePhD The basic theory is pretty simple. Getting everything right so it'll really work (well) is decidedly non-trivial.
 
Well, at most I think I'll just need a fat vector<char> for all the bytes I want. Then I need a free list to keep track of what's open and what's not open for use.
Since I'm only going to be allocating a single type, I just need to get a list of what's free and work with that.
 
hmmmm
fuckdiddlies
 
What happened?
 
I'll actually have to write my own iterator that slightly wraps std::list::iterator
annoying, if only slightly tedious
 
12:09 AM
@ThePhD Nice theory. Now read chapter 4 of Modern C++ Design and see how much you've missed.
 
I don't have it. :c
 
TITTIES
 
@Cicada A perfect example of what I don't have.
 
@ThePhD Get it. Trying to do this without it (or some similar guidance) -- well, you're not just reinventing the wheel, but trying to build a supersonic car, starting from a description of a horse and buggy.
 
I don't even know what to answer to these silly exam questions. The truth, or what the teacher expects?
 
12:11 AM
@JerryCoffin Ah. Well then. Hm. Um. Uh. .... Damn. Guess I'm gonna have to go buy a book...
 
@Cicada The latter, of course. Teachers don't want the truth.
 
@ThePhD Sad.
 
But it means I have to learn and remember a whole bunch of lies and falsehoods!
 
@Cicada What gives you your fucking degree.
 
Is it possible to get the common base class of two types?
 
12:11 AM
@ThePhD You could get Knuth V1 instead -- but it'll tell you a lot less about the C++ side of things, and a lot more about irrelevant heap management ideas, so it'll take quite a bit longer to get going.
 
@EtiennedeMartel T... T... Titties? ._.
 
@JerryCoffin I wrote my memory arena allocator without any books or anything
@Pubby std::common_type, I think.
 
Why is this std:: prefix so hilarious to me.
 
@DeadMG ...and have you tested it against something that actually works? :-)
 
@Cicada Maybe. It's up to you.
 
12:13 AM
@JerryCoffin Yes, it worked fine when I ran it with numerous Standard containers.
 
@DeadMG See @JerryCoffin ? Massive balls. Massive, massive balls. That's all you need. And if I don't have them, I'll be that much closer at the end of this exercise.
 
@DeadMG It doesn't compile ideone.com/by1ZxB
 
Ell
ahh feck I cba with php anymore
 
@ThePhD Maybe I'm just timid, but I prefer to have a clue of what I'm doing before jumping in. An hour or two of reading can save many more of experimentation.
 
Hm.
I need a new namespace for all this.. ... this memory stuff.
I shall all it... Recognizance. Because Memory isn't fancy enough. </latinbiologiststyle>
 
12:18 AM
This @chris guy is annoying...
@chris dude! Stop writing answers as comments. When you do, I feel bad adding my own answer. — Luchian Grigore 23 secs ago
 
fuckdiddlies
 
@JerryCoffin Since when have you known me not to waste a bajamillion hours? :3c
 
I've written a completely terrible insert function
 
Lulz.
 
@DeadMG Good.
 
12:20 AM
@ThePhD Hmmm...I guess I never paid close enough attention to be sure...
 
actually, it wasn't really that bad
just exception unsafe
 
@LuchianGrigore Damn -- I do that quite a bit too, especially for trivial answers to trivial questions.
 
Why would you do that?
 
chris always answers in comments
 
@LuchianGrigore And I do that a lot as well.
 
12:22 AM
@LuchianGrigore Cause if it's a trivial answer to a trivial question, it seems like a waste to do otherwise.
 
Ell
a waste?
 
Just run this query with his ID data.stackexchange.com/stackoverflow/query/947/… 962089
 
Don't forget that not everybody is interested in easy rep.
 
A waste of what?
 
Trivial answers always get the most rep per effort
 
12:23 AM
@Mysticial I know, but this is being actively against it.
 
One of the reasons why I stopped answering trivial questions is that I don't exactly want to the impression to a potential employer that I'm wasting time answering dumb questions.
The other part of it is that I've gotten sick of the same questions over and over again.
 
@ThePhD it resizes the number of buckets, doesn't resize individual buckets.
 
@Mysticial it's just as much time adding a comment.
 
@MooingDuck Ah.
 
@LuchianGrigore It's easy to get away with incomplete answers in a comment.
 
Ell
12:25 AM
@Rapptz heh just saw this :L lovely evil :L
 
@ThePhD it should only have one element per bucket, so resizing individual buckets defeats teh point
 
@Ell :P
 
Well, I don't know how else to get the size down.
 
aw fuckdiddles
 
er, Time*
 
12:26 AM
no default function template arguments in MSVC
 
Time to just write that pool allocator.
 
In comments you can do stuff like this:
Hint: Integer Overflow — Mysticial Sep 20 at 7:00
Put that in an answer, and you'll get downvoted for being terse and incomplete.
 
Ell
time for cereal :3
 
And another comment-as-answer:
() -> {}... — Mysticial Jul 8 at 7:13
 
Also, it's std::cout << "string" << std::endl; not std::cout << "string" >> std::endl;Rapptz Sep 19 at 2:47
lol
 
12:29 AM
Should I use new to allocate all the blocks of data I need internally, or revert to malloc for my Pool?
 
5 hours ago, by R. Martinho Fernandes
classe le_vecteur {
privé:
    taille_t la_taille;
publique:
    taille_t taille() const { retourne zisse->la_taille; }
};
If I could star this twice I would
I'm still laughing
 
I believe you
 
Hm. Time to sack up: malloc and realloc time.
 
Oh god
 
@ThePhD ::operator new unless you have a really good reason to do otherwise.
 
12:32 AM
Been messing with the "Actor" concept for a work project. It looks somewhat like this.. I wonder if it is a useful abstraction.
 
@ThePhD new, there's no reason for malloc in C++ code.
 
alright, people of no repute
quick overview
 
@Xeo std::tuple<T&&>?
 
2De
@DeadMG Why std::list ?
 
@ThePhD Name another data structure that can insert and erase randomly in O(1) that is not a list or a hash map.
 
12:33 AM
@DeadMG no allocator?
 
@MooingDuck Keeping it simples for now.
 
@EtiennedeMartel J'ai un doute affreux.
 
@DeadMG std:tuple<int> ?
Never mind.
 
@DeadMG also, minor space overhead if hash/predicate have no size
 
I thought std::list was a Linked List.
 
12:34 AM
@ThePhD it is
 
@ThePhD It is.
 
.... Then....
 
then what?
 
Don't you still have to search for the place to insert or erase?
 
@ThePhD it also has the required iterator guarantees that vector doesn't
 
12:34 AM
@DeadMG But std::list is really cache unfriendly for the modern cpu.
 
yep
but I can find in O(1) anyway- that's what the hash is for.
@StackedCrooked There's no choice- it has to be a linked list.
 
@DeadMG I contest that.
 
@ThePhD when the list is always 0 or 1 elements, search doesn't take long
 
@MooingDuck It's not. I have a different design.
 
@ThePhD it's by far the best
 
12:35 AM
@EtiennedeMartel "À chaque X est attribué(e) un(e) Y" Tu fais l'accord comment dans cette phrase? Sur X ou Y?
 
better iterator invalidation semantics
 
@DeadMG it's a hash, it can't be far from that
 
@MooingDuck I can store any number of objects in a bucket- any constant.
 
@DeadMG wait, the frick.... a vector of vector of list iterators? hmmm. interesting choice.
 
well
it should be a vector of array of list iterator
but that's gone out the window with no default constructible guarantee
vector<vector<list iterator>> is just simpler
maybe later I will find something like vector<array<optional<list iterator>>>
 
12:37 AM
... @___@
Confusing.
But seeing that has inspired me.
I shall improve my Dictionary.
 
Personne de bon en grammaire ici ? ;_;
 
@DeadMG why not just a vector of list of node? I don't see the upside.
wait..
processing...
 
@MooingDuck Firstly, simplicity. Look at how simple my iterators are.
and secondly, I can offer bidirectional access
and thirdly, I can offer the best iterator invalidation semantics- those of std::list
 
does list have an operation to move a node from one list to the other without invalidating pointers?
ah, splice.
@DeadMG vector of list of node could do that too.
@DeadMG however, that is a good point. Otherwise you'd have complex iterators like deque
 
@MooingDuck No, it can't.
because you have to go back to the vector to get the next list to move to when you're at the end of the previous list.
 
12:44 AM
oh right
well done
 
the Standard unordered_map doesn't offer them
one of the two things I really hate about it
 
why does find take a predicate when the map already has a predicate member?
 
so that you can provide an alternative predicate for a specific lookup
hmm, I actually completely fuckin' failed in that regard, because the members are never used! rofl
 
@DeadMG insert uses the hash
 
so it does
but the initial lookup to see if it was already in the table didn't
so you might have had two different results... :P
 
12:47 AM
you allow multiple nodes with the same key, has that been considered?
 
how so? that should not be allowed
 
@DeadMG nevermind
 
as in, strictly, the list could contain anything, but I'm not sure how that could actually come about
 
no constness, I assume you don't care
operator[] also uses the member hash
wtf is strikethrough
 
---
here's the next version
correctly uses the member in all cases where a custom was not supplied
 
12:51 AM
--- I think
vector<bool> has been specialized, right?
 
yes
 
@DeadMG I'm still uncertain about the idea of using a different predicate for equality. (and hash as well)
what's teh use-case?
 
Hm.
BitList or Vector<bool>
 
@MooingDuck Simple. Observe
 
@DeadMG and if it's for comparing multiple types to unique_ptr, then a member predicate can do all of those safely.
@ThePhD you mean bitset?
 
12:53 AM
consider something like
in fact, you don't even need a key to look up by, you can just look up by the hash itself
which, for many types, is a lot cheaper to, say, copy about
and not having to compute the hash for some types can be a major saving
for example, not having to hash a string saves you an O(N) operation in the length of the string.
 
Why not replace that with iterator find(AK&& k, std::size_t hash_value)?
nevermind, that doesn't address the wierdness at all. just changes it
 
Now I need to figure out
How Allocators are used by the std::
What functions do they call...
 
I feel like you can't trust the user not to screw up the hash/give an invalid hash.
 
eh
really, it's their problem
but it solves many problems- for example, hash_map<unique_ptr<T>, val> or hash_set<unique_ptr<T>>
 
@ThePhD each container has a allocator member. When the container wants memory, they use newmemory = myallocator.allocate(100);
@DeadMG true, it does greatly simplify that case
 
12:59 AM
Should... should I be subclassing allocator<T> ?
I... don't think I should...
 
@ThePhD I commonly do, saves a bunch of typing. But that's just laziness
 
no
there are no Standard components from which you should inherit, except some of the old shitty locales and iostreams business
 

« first day (775 days earlier)      last day (4172 days later) »