« first day (1144 days earlier)      last day (3804 days later) » 

user3010322
11:00 PM
@sehe Moves make it efficient. (Or less wasteful, whatever your taste is.)
 
@ThePhD the thing is, that requires T to be movable in the first place. std::unique_ptr<T> provides move semantics even if T is non-movable
 
C or C++? Pick one. Anyway, new and malloc are already portable. What are you looking for? — Etienne de Martel 1 min ago
 
I HAVE ANSWERED
 
@ThePhD Also, now your client absolutely needs to know how the resource is to be deleted. It's become worse
 

 bin

It's a bin, for binning things.
 
11:08 PM
> If you want code that is portable, don't write it in C++, use C.
..?
 
wut
 
other answer to that memory question
 
@ThePhD and what lovely colors. Not :c
 
user3010322
@melak47 The pinkw as just for making sure I could see the stuff. :c
 
I see..
 
user3010322
11:13 PM
It's better now!
 
conclusion: @ThePhD is a girl?
 
user3010322
Obviously not. :c
 
user3010322
 
user3010322
See?
 
user3010322
Now it's all compact and nice.
 
user3010322
11:13 PM
maximally-efficient boxes.
 
no umlauts? ö_ö
 
user3010322
It's just the ASCII character set
 
user3010322
I have another specifier for the Latin1 set, but, uh
 
user3010322
Not really interested. :B
 
11:14 PM
I wanna see a complete unicode rasterfont bitmap :D
 
user3010322
Never gonna happen. :P
 
user3010322
These rasterfonts are just for the quick 'n' dirty.
 
tbh, I thought D2D/DWrite was quick and dirty :D
 
user3010322
As if. >.>
 
user3010322
That thing is its own dragon.
 
11:16 PM
maybe not so quick...but still dirty
 
@melak47 It's neither, but it does actually work.
 
user3010322
Oh god
 
user3010322
I've dug myself a hole again >_<
 
user3010322
RasterFontDescriptionDescription
 
user3010322
metametameta.
 
11:22 PM
why are you doing this to yourself :p
 
BALLS.
 
user3010322
Did something go wrong?
 
I spent the last hour debugging this test, only to realize it doesn't work because I fucked up the test instead of the compiler.
 
user3010322
:3c
 
It might be that a C++ map can do all the same things as a C# map.
 
user3010322
11:23 PM
Nice.
 
But so unintuitive :\
 
user3010322
@melak47 I just need a better name for it.
 
@Pawnguy7 Why?
 
you know
I might do the smart-arsed thing and introduce a compiler warning for that.
 
Well.
 
11:24 PM
guys why don't we meld our consciousnesses into one?
 
contains is if the count of a key is greater than one.
You have to make your own hash.
Some other things I am forgetting right now.
Might be better overall, but a pain to learn :\
 
the contains thing is only for compatibility with multimap.
you don't need it to use a map.
and for C#, you need a custom hasher too if you don't use the default pointer-equivalence hasher (and C++ provides a T* hash by default too).
 
contains?
Thank you, your answer was very constructive and useful. I am using Visual studio but I'm trying to keep my source as C-like as possible and I am not actually using any classes. (I know it's not supposed to be used for C, but I think it's a much nicer IDE to get on with that alternatives such as Code::Blocks (which I have also tried)) — Pharap 3 mins ago
 
@DeadMG if it is provided by default, how do I use it?
Oh, and I think earlier, I was trying to figure out how to remove an entry from a map.
 
@Pawnguy7 You don't have to do anything special. Just do unordered_map<T*, value> and you will get it for free.
 
user3010322
11:28 PM
Argh.
 
The key isn't a pointer though.
 
user3010322
I have no idea what to call this... ... intermediary.
 
@Pawnguy7 C# doesn't provide non-pointer relations for free, either.
well, except for a few basic ones like string, integer, etc.
 
Define free.
 
I mean, shipped by default that you can use without having to define.
 
11:29 PM
Oh.
I wonder if I never used a map with non-primitives.
 
Define default.
 
I uh, what...what do I clear a depth buffer to? max float? -1? +-inf? Nan? :E
 
the fact is, there's no real difference between C++ and C# in which hash relations they can define and ship for you.
 
All I remember was, I didn't need to provide one.
 
user3010322
@melak47 Default clear is 1.0f
 
Ell
11:30 PM
@DeadMG I think reflection in c# helps
 
I don't care if it was a good hash or not.
 
user3010322
And default depth stencil is 0
 
Ell
Or ought to.
 
@Ell No it doesn't.
 
How do you find-erase on a map, though?
 
user3010322
11:30 PM
struct RasterFontDescription {
	std::unordered_map<codepoint, RasterGlyph> Glyphs;
	optional<codepoint> DefaultGlyph;
	String Name;
	float Size, LineSpacing, CharacterSpacing;
	FontStyle Style;
	Graphics::Image2D Raster;
};
 
user3010322
@melak47 This is what the intermediary looks like ^
 
Or do you have to go over the pairs manually?
 
@Pawnguy7 You probably ended up using the pointer one by default. Because in C# all classes are pointers by default.
 
Ell
@DeadMG Can't the compiler compose the hash functions of all of the member types?
 
user3010322
I think I need to give it a... better name, though.
 
11:31 PM
@Ell No.
that wouldn't really make sense.
 
@ThePhD oh, right the depth stuff is normalized to [0, 1] by the view/projection matrix (unless you screw up? :D)
 
> resolve all conflicts and rerun the merge to apply the remaining unmerged revisions
 
@DeadMG So you are saying it wouldn't work on the basis of how the core language works?
 
Fuck you, SVN.
 
user3010322
@EtiennedeMartel :P
 
user3010322
11:32 PM
Stop using SVN for your personal projects.
 
@Pawnguy7 Right, In C# the T* hash is a lot more meaningful because everything is a fucking pointer.
 
@ThePhD oh god, why...how is this quick :D
 
user3010322
@melak47 Should be.
 
@ThePhD I'm at work.
 
but you'd end up with the same problem quicklike if you tried to use a value type or something.
 
user3010322
11:32 PM
@EtiennedeMartel Tell your boss to quit.
 
Hrm.
Anyway, the interface is just.. pain-free.
You can just remove(thing), and poof, it is gone.
 
@ThePhD I'm trying to become a lead here. Throwing a tantrum over that would be pointless.
 
user3010322
@EtiennedeMartel Ooh. Well, then, grin and bear it.
 
user3010322
And when you get in charge...
 
user3010322
Muahaha... ahahahaha... ahahahaaaaaa AAA HAA HAAAAHAAAAAAAAAAAAAAAAA
 
11:33 PM
@Pawnguy7 You can do that in C++ too.
you can do map.erase(thing), and poof, it is gone.
 
Is it just me or Nvidia cards are much more expensive than AMD cards?
 
Doesn't it take an iterator?
 
there are two overloads.
one takes an iterator, the other takes a key.
 
user3010322
@R.MartinhoFernandes Go through EVGA, usually cheaper if you're not buying directly from NVidia. Also warranties.
 
map.erase(key) is effectively map.erase(map.find(key)).
 
11:34 PM
@ThePhD Nvidia doesn't have 6-monitor in a single board unless I go Quadro.
 
I am pretty sure I tried this earlier and it didn't compile :\
 
user3010322
<_>
 
@ThePhD For once I agree
 
Define definition.
 
user3010322
You and your six monitors.
 
11:35 PM
@R.MartinhoFernandes you have 6 screens? now I gotta get over there :p
 
@R.MartinhoFernandes They usually offer more punch.
 
user3010322
@melak47 Steal two, bring one back for me. :D
 
@R.MartinhoFernandes Yeah. They usually have better drivers.
 
the reality is, as far as I am aware, neither nVidia nor ATi offer substantially better value for money right now.
 
@melak47 I'm thinking of getting a set.
 
user3010322
11:35 PM
How much is it going to cost you?
 
Wow, 6 minutes without internet.
 
@Jefffrey your avatar changed! :o
 
Ok, apparently I suck at finding methods that make life easier, and my opinion was due to some raw things I did.
But I still hold the opinion that it isn't as intuitive.
 
@R.MartinhoFernandes aren't 4 screens enough? :E
 
user3010322
@Jefffrey's dinosaur si no longer very dapper. :c
 
11:36 PM
Param(char op[], int value) : Operation(op){

    (*this).op=op;
    (*this).value=value;
    }

    int getValue(){
    return this->value;
    }
 
@melak47 Nah, you are seeing things :P
 
@Jefffrey new avatar?
 
there's that (*ptr).stuff again
 
user3010322
@Rapptz -> is ugly and should die.
 
@melak47 I don't care. You will not talk me out of it.
 
11:37 PM
@ThePhD Grumpier though >:(
 
user3010322
I wish there was an easy alias for *this built into the language.
 
It's my Christmas gift :<
 
-> is the best operator
 
@R.MartinhoFernandes I have 3. and now my landlord told me I'm using too much powah and to only use the third one if I really need it. :C
 
it actually makes sense
 
11:38 PM
@Rapptz go back to PHP!
 
I don't use PHP
 
@melak47 lolwut?
 
user3010322
@melak47 Really, that's his reason?
 
user3010322
. operator best operator.
 
Is there an advantage to this being a T * instead of a T?
 
11:38 PM
Well, PHP uses -> for everything except arrays, so maybe you should try it.
@Pawnguy7 Yup
 
Isn't a monitor like, 50W?
 
yep
 
@Jefffrey care to share?
 
(Unless Apple, because Apple good)
 
user3010322
@Pawnguy7 Consider the case where T& is this: self_ptr = &this;
 
11:39 PM
@Pawnguy7 share what? the avatar? why would you share an avatar?
 
user3010322
Now, someone overloads operator&
 
Oh.
 
you mean ptr_to_self_ptr? :D
 
user3010322
YOU DUN GOOF'D.
 
People overload that?
 
11:40 PM
just make operator& unoverloadable
 
@ThePhD What?
No.
 
People would even overload sizeof if they were allowed to.
 
user3010322
@R.MartinhoFernandes I was giving an example.
 
It's a bad example.
 
user3010322
That's a plenty valid example.
 
11:41 PM
I wish I wasn't so lazy and would get a job so I could afford things, and stuff :|
 
No, it isn't.
 
user3010322
Someone overloading operator& on their own class and forgetting it when they do &this is a good reason why this is already a pointer and not a T&
 
There are only hysterical reasons for it.
 
And you cannot overload ->, correct?
 
@ThePhD No, it isn't.
@Pawnguy7 Er, wrong.
 
11:42 PM
@Pawnguy7 ...you can :p
 
how do you think you can do std::unique_ptr<T>(pointer)->method()?
 
Must be some kind of restriction?
 
sound of bubble bursting
 
@ThePhD There's no good reason to try to prevent that, because there's no good reason to write such code.
 
user3010322
Fine, it isn't.
 
11:42 PM
@DeadMG You seem to be thinking I use unique_ptr.
 
@Pawnguy7 what kind of outing is this?
 
That problem is a problem with operator& in any situation.
 
@Pawnguy7 Oh, yeah. unique_ptr is the single most useful class in the entire Standard library and if you're not using it often you're doing it wrong.
 
self_ptr = std::addressof(this)
 
@ThePhD Bjarne has fairly clearly said that the only real reason this is a pointer instead of a reference is that the language didn't have references yet at the time.
 
11:43 PM
And the solution is the same as any one situation. std::addressof
 
YAY finally I got that fucking stack overflow.
 
@Pawnguy7 std::shared_ptr is an example
 
@melak47 outing?
 
@DeadMG If you're using it often you might be doing something wrong too.
 
well, as per usual, it would really depend on what exactly you're writing.
 
11:44 PM
@Pawnguy7 you admitted to the assembled esteemed Lounge<C++> that you do not use unique_ptr :D
 
but I'd argue that most application use involves a healthy dose of unique_ptr.
 
I haven't written a single usage of unique_ptr at work.
 
user3010322
@JerryCoffin Sadface is sad.
 
@Rapptz Woah, didn't know that existed. Should people always use that for types that are not primitive, instead of &?
 
Though that might change next week because of one of the refactorings we have planned.
 
user3010322
11:45 PM
Why don't they introduce a new reference one for this then? :c
 
@R.MartinhoFernandes Oh really?
all shared_ptr?
or some custom memory management solution?
 
@Jefffrey only use it for retards who overloaded operator&
 
@DeadMG Not that either (though there are already there too many shared_ptrs around and that's what we'll be refactoring)
 
user3010322
@Jefffrey Or generic template code /cc @Rapptz
 
Well, you never know...
 
11:46 PM
@melak47 I told myself I would from now on, but I haven't needed an owning pointer since.
 
@ThePhD in generic code you check if it's overloaded
 
@Pawnguy7 that's ok I guess :p
 
user3010322
@Rapptz That's silly.
 
no it isn't
 
user3010322
template <typename T>
void work ( T& arf ) {
     // ALWAYS D:<
     T* addr = std::addressof( arf );
}
 
11:47 PM
Yeah, KISS man, KISS
 
user3010322
work( my_integer );
work( some_faggots_library_type_and_they_overloaded_it_like_a_dumbass );
 
why would you use std::addressof for no reason
 
@DeadMG Some of our classes use boost intrusive pointers, and IMO those are the only uses of non-unique_ptr that are acceptable. Most of the shared_ptrs are really just lazy.
 
user3010322
It's a contrived, but real example.
 
user3010322
It was one of the first things STL slammed me on when I presented my optional to him.
 
11:48 PM
@R.MartinhoFernandes Intrusive certainly has a use case when dealing with things like COM.
 
@Rapptz the reason is: people that use my generic function might overload & for T.
 
@Rapptz Why would you bother checking if it's overloaded if you have a ready-made thing that works for any?
 
user3010322
@Mysticial People didn't like on their profiles.
 
@R.MartinhoFernandes because addressof isn't constexpr :v
 
11:49 PM
@melak47 How 'bout this: I never use unique_ptr? e.g. out of 6500+ answers on SO, I've mentioned unique_ptr only 9 times, and not one of those is in actual code.
 
How can an address be constexpr, ever?
 
Why wouldn't it?
 
Because every time the program run, the address might change?
 
k well, time for the last episode of breaking bad.
 
Also it is not known at compile time AFAIK
 
I think everybody missed the most glaring error. The lifetime of isStarted... — sehe 10 mins ago
0
A: passing bool by reference and use its latest value

seheThe biggest problem (besides std::ref or boost::ref required to pass references to thread), is that you are passing a reference to a temporary MyClass::aMethod() { ... bool isStarted = false; } /// Oops at the end of the method, `isStarted` no longer lives Any access through the sta...

 
@Jefffrey An offset will be known at compile time, and the loader can fix up the base address at load time.
 
FINALLY
fucking test passes.
 
@Jefffrey Doesn't matter. In a constant expression, it's constant.
 
11:53 PM
@DeadMG you should explain the purpose of tests to me
 
simple
when I made a boo-boo and broke basically all overload resolution, ever, I knew when I had fixed all the bugs, because my tests passed again.
 
@JerryCoffin what do you mean by loader?
 
You only need tests if you write bugs. :P
 
user3010322
@Jefffrey Application loader, I'd guess.
 
well I just passed this
 
user3010322
11:54 PM
@R.MartinhoFernandes I don't write bugs!
 
type movable {
    type(this->rvalue arg) {}
    type() {}
}
f(movable x) {
    return false;
}
f(auto->lvalue x) {
    return true;
}
Main() {
    var := movable();
    return f(var);
}
 
But yeah, finding regressions is one the bestest things.
 
@Jefffrey The part of the OS that loads code (and "stuff") into memory to create a process from one or more executable files.
 
C++ issues a compiler error on equivalent code, but Wide will accept it.
 
@ThePhD You write unanticipated features!
 
11:54 PM
As I understand it, it tests things individually, to find bugs that normal input might not?
 
user3010322
@sehe Exactly! :D
 
If you have ever done any significant refactoring you can easily appreciate the value of having a test suite to stop your fall.
 
user3010322
Everyone unanticipated feature is a pleasant surprise.
 
Ell
What does one call the shortest route from the root to a particular node in a tree - does it have a particular name?
 
namespace std { int* addressof(foo& arg) { return &(arg.thing); } }
 
11:55 PM
@JerryCoffin is a C++ address always an offset?
 
@Ell It's the optimal path.
 
what now. :E
 
user3010322
@melak47 <_> Wat.
 
@Jefffrey Doesn't really matter. It's an "address". That it has numbers somewhere is not relevant.
 
@Pawnguy7 Give or take. You also run tests because you can easily automatically run many inputs, and you know what result they should produce. So it's easy to mass check the outcome.
 
11:56 PM
@ThePhD I guess you'd have to be pretty malicious to overload std::addressof, though? :p
 
user3010322
@R.MartinhoFernandes Sadface :c
 
@R.MartinhoFernandes Well, I imagine a C++ address to be base + offset. If the offset is constant but the base isn't, how can the whole address be constant?
 
Given constexpr int x = 42; the address of x is &x and it is a constant expression.
 
@DeadMG Sort of like command line arguments?
 
@Jefffrey That's pretty much a question of how the OS is designed/implemented, but yeah, the linker will set things up as offsets from a base address, and the loader will "fix up" the addresses based on the base address where it loaded the code. Main exception is Position Independent Code (PIC) which typically uses something like IP-relative addressing, so it doesn't have any addresses that need fixing up.
 
11:57 PM
@ThePhD .....what did you expect?!
 
@Pawnguy7 Well, those are useful for implementing tests, but have little other relation to them.
 
Ell
@deadmg but one specifically from the root of the tree?
 
@Ell ...there's exactly one route from the root to a particular node in a tree... that's one of the basic tree properties.
 
@ThePhD told ya.
 
@Ell The start and end nodes are irrelevant.
 
11:58 PM
@Jefffrey Given constexpr int x[2] = { 17, 42 }; the address of x[0] is &x[0] and it is a constant expression. &x[1] - &x[0] is a constant expression and has value 1. There's no need to know the "real" values of the addresses for any of this.
 
a path from one node to another is the optimal path.
 
user3010322
If you have a templated type T, and you have a constexpr of that T, but the T also had an overload for operator&, could you still get its address?
 
also, pathfinding on trees doesn't really make much sense because as Griwes points out, there's only ever one path from the root of a DAG to any other node.
 
@RemyLebeau I choose to present the typical pattern. Also, I don't see how it would be more relevant. Simply remove B, rename { IConable -> A } and { A -> B } and you arrive at your sample. If you don't want pure virtuals, implement it :) — sehe 40 secs ago
 
@DeadMG Are you telling us a dag is both directed and acyclic :O?
 
Ell
11:59 PM
@deadmg sorry I phrased my question badly - what do you call the path from the root node to any node? Eg then "filepath" in a hierarchical filesystem, does it have a specific name?
 
@ThePhD not a constexpr T*
 
@DeadMG I was wondering on mass testing. If the input is in the code, you have to do it manually, whereas with args, you don't.
 

« first day (1144 days earlier)      last day (3804 days later) »