« first day (879 days earlier)      last day (4068 days later) » 

11:00 PM
yay for ~consistency~
Style question
 
@Xeo switch on anything cc @Zoidberg @Pawnguy7
 
If I explictly create destructor, move constructor&assignment operator, should I create missing two (copy versions) as private explicitly or is inheriting from boost::noncopyable ok? (to complement rule of five)
 
waaaiiit, if I can overload functions based on &&, can I overload the destructor based on &&?
can I have temporaries call a different destructor?
 
Ell
I think inheriting is fine
 
11:04 PM
@JerryCoffin looks nice
 
@MooingDuck No -- dtor doesn't take arguments, so no overloading.
 
Ell
Damn coliru still doesn't work on mobile :(
 
@JerryCoffin no, not in the arguments, in the function specification thing. Like a const member function.
answer: no, can't overload the destructor by any means. (according to GCC)
 
@MooingDuck Oh -- still no: "A destructor shall not be declared with a ref-qualifier."
 
@JerryCoffin curses, that would have been awesome
 
11:07 PM
I believe the complete line is "curses -- foiled again."
 
hey, guys
TVector2 ( ) {
	x = 0 ;
	y = 0 ;
}
^ Should I default-initialize my barbone structs to 0?
Or, should I just let it garbage-initialize?
my barebone structs*
 
@ThePhD TVector2() :x(),y() {}
 
@MooingDuck Can't do that, RVector2 (TVector2's base class) is a PoD and has the (public) members
 
@ThePhD NO
let them garbage-initialize
 
RVector2 (raw Vector2) garbage-initializes (because it's a PoD)
 
11:11 PM
also don't write your own vector class, but you already know that
 
@MooingDuck I fail to see the need for that.
@BartekBanachewicz Why?
 
@EtiennedeMartel expression templates, but you're probably right. probably most cases detecting the difference would be wrong.
 
@EtiennedeMartel user shouldn't pay the cost if he doesn't need it
 
Ell
I really need to learn get!
 
@Ell to learn what?
 
Ell
11:11 PM
then I can contribute to minifract propelrty
 
@Ell Do you mean "Git"?
 
@BartekBanachewicz When do you need to leave it garbage initialized?
 
Xeo
@MooingDuck Cool. :) Like I said, it's not too complicated to do. Of course, I want to make that thing look more awesome now.
 
@EtiennedeMartel std::vector::resize()
 
@EtiennedeMartel When you don't want to use it duh
 
Ell
11:12 PM
oops. Yes. I make a lot of typos on this thing :P
 
@BartekBanachewicz reserve
 
@CatPlusPlus I always confuse these two :/
 
As it stands, almost all my Vector2/3/4 Matrix3x3/4x4 default to a 0-size (or Identity).
 
@Xeo I'm trying to add template params for hashing/equal/allocator now, but not sure what else to do
 
I mean, use reserve and you don't have to leave any unusable garbage lying around
Default ctor should default-construct
 
11:13 PM
@BartekBanachewicz And even then it's micro optimization
 
And that means leaving an object in an usable state
 
@EtiennedeMartel yeah, it is.
 
Xeo
@MooingDuck Expression templates, allowing different return types with std::common_type<...>, nicer syntax maybe (abusing operator overloading).
 
Hm.
 
2 mins ago, by Bartek Banachewicz
also don't write your own vector class, but you already know that
 
11:13 PM
So shut up about your useless microoptimisation and default-init your members kthx
 
@Xeo return types? What should return? It's a switch!
 
@CatPlusPlus <3
 
@BartekBanachewicz resize initializes them to a copy of what you pass to resize. reserve doesn't create objects (even unitialized ones) in the extra space at all (it just allocates raw space with the Allocator, then creates items in that space as you push them -- never creates an object with explicitly initializing it from something.
 
OH GOD
 
Xeo
@MooingDuck Conditionals can also be expression, like say in Haskell.
 
11:14 PM
Skyrim is available for me on Steam
It only took them like a year
 
It was more of a preference thing, not more of an optimzations thing.
But, uh. Hokay.
 
You prefer spurious states in which your objects are unusable?
 
@Xeo So you want it to act more like c?t:f?
 
Always hold your invariants
 
Xeo
11:15 PM
@MooingDuck That's one way to think of it, yes.
 
And by always I mean always
 
@CatPlusPlus ...otherwise they're not invariants after all.
 
Correctness dammit
 
@ThePhD if you are not optimizing then default-initialize
also don't write your own vectors
 
If you are optimising then default-init too and maybe use a profiler instead of doing crappy micro-opts
Correctness > performance
 
11:16 PM
@Xeo the trick is I have to know the return type for the member before I'm actually given any cases.
 
Anyway
 
Xeo
@MooingDuck I probably wouldn't even use std::unordered_map, or enable it depending on the number of switches. A straight std::find or even std::lower_bound over a std::vector of pairs should be as fast / faster due to contigues memory.
@MooingDuck Expression templates~
 
Skyrim is still 30€
I want a sale
 
@CatPlusPlus Skyrim sucks.
 
All sales were when it wasn't available
Fucking retailers
 
Xeo
11:17 PM
And then CommonType<Cases::result_type...>
 
@Xeo oh, now I get why you said that a moment ago
 
Xeo
I just noticed I'm dominating the starboard.
Rawr
 
@Xeo the point of switch is O(1), if you want chained ifs, use chained ifs.
 
posted on March 13, 2013 by Scott Meyers

The bane of publishing code for consumption on a variety of platforms is that the available horizontal space varies.  I've blogged elsewhere that I want to avoid horizontal scrolling or bad line breaks in code, and I'm working with my publisher on how to do that. I'd like your help, too. My understanding is that on Kindle and iPad (the platforms for which I currently have some data), the

 
@BartekBanachewicz I suffer from lack of hilarious sandboxes
 
Xeo
11:18 PM
@MooingDuck For small enough N, O(N) is O(1)
 
@CatPlusPlus Saint's Row 3?
 
@Xeo for small enough N the overhead is irrelevant.
 
Xeo
Is what I'm saying.
 
Chained ifs are fugly
Point of switch is to sugar over them to make them not fugly
 
Xeo
You'd probably want to profile that, though
 
11:20 PM
Also pattern matching
 
Xeo
Nobody said we're doing chained ifs
 
2 mins ago, by Mooing Duck
@Xeo the point of switch is O(1), if you want chained ifs, use chained ifs.
 
Xeo
@CatPlusPlus We're talking implementation of an any_switch, and I'd use std::find or std::lower_bound.
 
@Xeo std::find over a vector would be effectively the same as syntactic sugar over chained-ifs.
 
I don't know what you're talking about I'm just talking about switch vOv
 
11:21 PM
switch(myusertype) {
    case myvariable: dostuff(); break;
    case myothervariable: dootherstuff();break;
};
 
Xeo
@MooingDuck I don't see the problem with that, tbh. As long as it looks nice...
Hmmm
hmmmm
 
@Xeo fair enough I guess
also my current design doesn't handle a default case, but that's a trivial change.
also I'm copying std::function<void()> where I probably only need pointers.
 
Xeo
boost::find({ref(cases)...} | map_keys, str);
Hmmm
@MooingDuck with expression templates, you'd need neither
Just have every switch be a different type for different input / cases / whatever, like std::bind's return type.
 
@Xeo yeah, expression templates would be better.
 
Okey, I think I fixed these memory leaks
 
Xeo
11:24 PM
You had leaks in the first place? ;)
 
I am wrapping C code
 
void foo() {
    static std::function<void()>* ptr = &([&]{std::cout << "AWESOME\n";});
    (*ptr)(); //is this valid the second execution?
}
 
Xeo
ew
 
and @Cat pointed out rather reasonably that throw skips deletion
So I wrapped shit in unique_ptrs
 
Xeo
@MooingDuck A lambda is not of std::function type
 
11:25 PM
right right hmm
 
well, @Xeo, maybe you will be able to shorten that up a bit
auto dib = std::unique_ptr<FIBITMAP, FreeImageBitmapDeleter>(
		FreeImage_LoadFromMemory(fif, fm.get()), FreeImageBitmapDeleter());
 
and if I convert I'd clearly be taking the address of a temporary, so that wouldn't work at all
 
any way to deduce arguments? :<
 
Xeo
static auto a = []{...}; a();
 
@BartekBanachewicz yes
 
Xeo
11:26 PM
@BartekBanachewicz make_unique
 
Write a make_unique that takes a deleter
 
user142019
C y u no lambdas.
 
@CatPlusPlus I failed miserably at first try.
 
Xeo
@Zoidberg GCC block expressions! :D
 
@Zoidberg because: ketchup flavoured crisps!
 
11:26 PM
uh, 2nd try.
 
user142019
@Xeo can I convert those to function pointers? :L
 
Xeo
int i = {int a=5, b=5; a*b;} // i == 25
@Zoidberg lol, no
Or idk, tbh
 
user142019
@sehe I have coconut-flavoured cookies!
 
user142019
@Xeo :(
 
@Zoidberg Again? inb4 weight watchers
 
11:27 PM
template <typename T, typename Deleter, typename... Args>
std::unique_ptr<T, Deleter> make_unique(Deleter&& deleter, Args&&... args) {
    return std::unique_ptr<T, Deleter>(new T(std::forward<Args>(args)...), deleter);
}
 
user142019
I'm not fat, don't worry.
 
From memory
 
@Zoidberg yet
 
user142019
Wait.
 
ok
 
user142019
11:27 PM
I'm using clang anyway. I can use blocks.
 
Alternatively default-construct deleter if you don't need to pass arguments or whatever
And maybe call it make_unique_deleter
Or just steal @LucDanton's implementation
 
@Zoidberg s/can/can't/?
 
user142019
@sehe can
 
Xeo
or if you don't have variadic templates available...
4
A: Is there a way to write make_unique() in VS2012?

XeoYou could use Boost.Preprocessor to generate the different parameter counts, but I really don't see the advantage of that. Simply do the grunt job once, stuff it in a header and be done. You're saving yourself compile time and have your make_unique. Here's a copy-paste of my make_unique.h header...

 
If you don't have variadic templates available stop using MSVC :haw:
 
11:30 PM
Variadics work with the CTP./
I don't know why people aren't using the CTP.
 
don't laugh
 
Not using the CTP is a crime.
 
Xeo
@ThePhD Buggyadics.
@BartekBanachewicz NO
NO NO NO
 
@Xeo Only for function declarations.
 
i thought so.
 
11:30 PM
:8252002 Unsafe
 
Xeo
The basic idea is to conceal the new
@ThePhD Everywhere
 
Xeo
Do I have to remind you that I filed 11 variadic bugs when I played around with it?
 
@Xeo I am getting an initialized pointer
 
Xeo
11:31 PM
Just trying to port some code from Clang?
 
To hide new, to not repeat the type
To be more exception-safe
 
5 mins ago, by Bartek Banachewicz
auto dib = std::unique_ptr<FIBITMAP, FreeImageBitmapDeleter>(
		FreeImage_LoadFromMemory(fif, fm.get()), FreeImageBitmapDeleter());
 
Variadics only fail me for Function Declarations (e.g. when trying to make my Event callback system).
 
Look again
 
Otherwise, variadics are behaving.
 
11:31 PM
@GManNickG: Yeah, I recall having this discussion about "why didn't you use the iteration facilities" before, and searched for it. Found it in this question. :) I'll just blatantly steal from your answer there. — Xeo Sep 23 '12 at 0:40
^ lol
 
FreeImage_LoadFromMemory returns proper pointer
 
Xeo
kek
 
it's C remember?
 
OH RIGHT
THAT WAS THE REASON I WAS USING STD::VECTOR
 
Xeo
11:32 PM
@BartekBanachewicz Welp, my condolences then.
 
@CatPlusPlus I am having a deja vu.
 
I was sometimes getting resources by index, and not by key.
 
@CatPlusPlus could do with a std::forward<Deleter(deleter) too, right?
 
@sehe Yeah
Also really using abused unique_ptr on call-site is not good
 
Xeo
@Bartek: Write an adapt_unique then
 
11:34 PM
For the same reason generic execute-around driver is not meant to be used on call-site
 
^ this looks promising
@Xeo what the hell would be adapt_unique?
 
make_unique but without making
@BartekBanachewicz Yeah it's as fancy as it gets
 
@CatPlusPlus isn't that what I have written not-so-long ago?
 
Also @LucDanton mixed tabs and spaces here bitbucket.org/mickk/annex/src/… how could you
 
@CatPlusPlus Not supposed to happen :/
 
11:35 PM
High-Five for Luc Danton!
 
> Google Reader will be retired on July 1, 2013.
 
@CatPlusPlus what
 
What why why why why
 
@Xeo so was my version ok or no for it?
 
Xeo
@LucDanton I think you have a bug here - shouldn't you pass along a deleter_tag the first time, instead of the deleter 2 times?
 
11:37 PM
@BartekBanachewicz Yeah for that it'll be fine
Just add forwarding
And you don't really need trailing return type, unless you just like it vOv
 
forwarding of pointer?
or of deleter?
 
Xeo
deleter, likely
 
@BartekBanachewicz holy fuck. that's fancy @LucDanton
 
wut
 
11:38 PM
Lol
 
@Xeo I think so, yes.
 
Google is dropping the Product Search API
So that other people can't use their shopping data to build their apps
and so Google can make their own
 
Xeo
@LucDanton Or rather, you have a name clash I think
 
How cute. :3c
 
Xeo
> ANNEX_DEFINE_PARAMETER_NAME( deleter );
 
11:39 PM
Haha, yeah.
 
@CatPlusPlus whoa. what. where? I depend on that!
 
Xeo
Guess I like deleter_tag for the argument still
 
@sehe you are not the only one. I recently learned how well it works on iPad
 
Xeo
Like allocator_tag
 
11:43 PM
Sigh. More headbashing. Pong decided to stop working, again.
 
@Pawnguy7 I wrote a pong using SFML back in high school
Too bad when I copied my old projects
it stopped on PD
 
That is almost my exact situation.
 
@CatPlusPlus OUCH. Well, on the bright side, google takeout is nice
 
which means Pong is lost, if my friend didn't backed it up
 
 
11:47 PM
@Pawnguy7 is your code on github or something?
 
user142019
WTF GitHub. There isn't a single line of Objective-C in my project.
 
No.
 
@Zoidberg .h
@Pawnguy7 Y?
 
user142019
@BartekBanachewicz it's only C!
 
Never used it before.
 
user142019
11:47 PM
(And a shell script.)
 
@Pawnguy7 why don't you start now? :)
 
What exactly is it? I heard version control.
 
it's a web interface for Git, mostly
 
user142019
Without version control, you're basically doomed.
 
user142019
@BartekBanachewicz and host.
 
11:48 PM
and host, yes.
 
even I have version control
 
Well, if you are on a personal one-person project, I doubt it makes much difference.
 
@Pawnguy7 untrue.
 
it does when you accidentally delete shit.
trust me, I've been there
 
it does when you want to share code
 
11:49 PM
yeah
 
4 mins ago, by Bartek Banachewicz
Too bad when I copied my old projects
 
My project have not yet gotten that big, but I know what you mean. And yes, if I did.
 
a lot of people in the chat wish to know about my existing Wide implementation.
 
Wide?
 
the language I am constructing.
 
11:50 PM
> Alas, Microsoft Word 2010 (the version I'm using) lacks support for conditional text, something that quite surprised me, because both FrameMaker and OpenOffice/LibreOffice have had it for years. Scott Meyers "The Line Length Problem"
lol ^
 
Recommend RSS readers ITT
 
Yeah. That'd be SUPERB
 
iDevice.
 
Is it quick and easy to upload to git?
 
I guess there's a big opportunity for competitors now
 
11:52 PM
@Pawnguy7 Yes (and GitHub- git is the vcs, and github is the website).
 
We're not buying iCrap don't recommend anything from Apple tia
 
@Pawnguy7 you can't "upload to git". Perhaps you meant "God"?
 
I meant github, sorry
 
Uploading to god requires a lot of thrust
 
@Pawnguy7 if you aren't using git you just don't know what you're missing. It's saved me so many times I can't even count them.
 
11:53 PM
@Pawnguy7 you can use GitHub for windows
 
@Pawnguy7 Yeah. it's quick. And it's easy. Provided that you 'understand' PK authentication (think SSH)
 
@CatPlusPlus noob.
 
Is it a download or purely web pased interface?
 
@Pawnguy7 GitHub for windows is a desktop app
 
@Pawnguy7 if you don't, there's noob-friendly Github for Windows (which otherwise is very "meh" in my view)
 
11:53 PM
NOOOO
 
it is meh but enough for a total beginner
 
MY FAMILY GOT MY AN ANDROID SMART PHONE
 
ahahahahha
 
I DON'T WANT TO BE CONTACTABLE SHIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIT
 
11:54 PM
So, kind of like dropbox?
 
@Pawnguy7 with lazers and shit
just try it.
 
@Pawnguy7 are you familiar with vcs in general?
 
Not at all, besides why they are useful.
 
@ThePhD well, my android smartphone is great at everything except being contactible: I just can barely hear the phone speaker -> I always use "handsfree" with volume at 5%...
 
@Pawnguy7 github has a some nice introductory stuff in the 'help'. It's 100% worth learning at least the basics. Even for 1 man projects.
 
11:55 PM
@ThePhD hey, it could have been worse. it could have been a WP7 :p
 
@melak47 WP7 is great as long as you don't want any apps.
 
But I'd want to develop on devices I have.
I could develop on a WP8.
I wouldn't bother with an iPhone (they're shit anyways).
 
@ThePhD I said Wp7 :p
 
But Android...
...... That means Java!
 
It turns out this was (obviously) a defect, but I found out after teh 2 years warranty period had expired. You know, I don't call a lot :)
 
11:56 PM
at least android has C++! :p sort of.
 
@melak47 NDK
 
Hei lads and lasses
 
I had most things working - visuals, physics, sound, etc, then I changed something... it all broke. Every part. Sigh.
 
There's the ndk
 
NDK is nightmarish.
And only allowed in certain places.
 
11:57 PM
@Pawnguy7 that's the point of VCS. You can easily rollback changes and do regression testing
 
@Pawnguy7 sounds like exactly why you need vsc
 
@ThePhD why? it's cross compiling. It doesn't get comfy
 
vcs*
 
Probably. I think it is also a good indication my first design sucked :D
 
Anyway, this has been fun. Just wanted to look at these chats.
 
11:58 PM
> Notably, using native code on Android generally does not result in a noticable performance improvement, but it always increases your app complexity. In general, you should only use the NDK if it is essential to your app—never because you simply prefer to program in C/C++.
 
@JohnTyree You succeeded. Achievement unl... etc.
 
you don't get to just leave now, though.
 
Not nearly enough pedantry for my tastes :D
 
> never because you simply prefer to program in C/C++
 
@ThePhD C/C++
 
11:58 PM
Thanks for the broad choices in architecture there, google. =[
 
@JohnTyree hhuhuhuh. You must be new here
 
@wilx slowpoke
 
@sehe well I did just explicitly say that
 
:)
Hey! I have been doing house chores!
 
11:59 PM
what'd you do that for :p
 

« first day (879 days earlier)      last day (4068 days later) »