« first day (670 days earlier)      last day (4278 days later) » 

12:12 AM
@R.MartinhoFernandes I added a comment showing that it can be done in a sane/typesafe way
 
@melak47 I know it's late, but did you try the WICU (Windows Installer cleanup utility)?
 
@R.MartinhoFernandes the what?
 
I had a similar problem while uninstalling the VS2008 beta before, and that fixed it.
 
I guess I can give that a try
but now I already have a fresh windows install so :p
 
@MooingDuck I can't see it :S
Nevermind, found it.
 
12:20 AM
still working on a constless clone
error: 'add_reference' is not a member of 'std'?
(and that's after #include <type_traits>)
 
currently have std::declval<std::add_reference<Type>::type>(), trying to get a Type&
 
greetings everybody... how's it going?
 
@MooingDuck And how would you expect to get a Type&& if you wanted?
 
@R.MartinhoFernandes I assumed std::declval<Type>()
 
12:29 AM
There's no add_reference because there is more than one type of reference now. There is one for each: add_lvalue_reference and add_rvalue_reference.
 
@R.MartinhoFernandes perfect, I need an lvalue
 
herro herro, how's everybody doing?
 
there we go, less const-happy version: ideone.com/8OFNK
 
damnit. being drunk and using pentadactyl don't mix that well sometimes.
 
I like how in perforce selecting "get latest version" doesn't do anything at all. </sarcasm>
 
Ell
12:52 AM
hi all
 
Ell
just listening to blackbird by the beetles
such a good song
 
wa that the revolver album
great album
 
Ell
*beatles
 
reminds me that i gotta learn the guitar thing at the beginning of that song
 
12:57 AM
I hate "access denied" when accessing files in teh root directory as admin in Windows.
 
Ell
my brother used to play it, sounds really nice
I tell you what sucks though, hit chip's cover of sexual healing. really bad music.
 
especially when all I'm trying to do is rename
 
Ell
access denied does suck
 
going home now
later all!
 
Ell
bye :)
 
1:00 AM
bye!
 
Ell
woo I may be going to Norway next year!
 
"Personnel: Paul McCartney – vocal, acoustic guitar, foot tapping." he he
 
Is there a scope guard in boost?
 
@Ell lucky you!
 
Ell
I will be being thrown in the deep and to learn the language
 
1:03 AM
0
A: C++ - Create polymorphic object on stack?

R. Martinho FernandesDisclaimer: I definitely don't think this is a good solution. The good solutions are to either rethink the design (maybe OO polymorphism is not warranted here given that there is a bounded number of possibilities?), or to use a second function to pass along said polymorphic object by reference. ...

 
@R.MartinhoFernandes not afaik, but there was an attempt to add one
 
@Konrad, ok, I did it :)
 
however, with c++11 a scopeguard class is trivial
if you're not concerned with absolute efficiency
you just store a std::function<void()>, that's all
don't need to support the Marginean reference trickery
 
SRN
i have a question, if you cannot use to regex to parse html -- http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags

then how do html parsing libraries work (implemented)?
 
With regexes.
They're likely to use regexes for tokenization and then just use a regular parsing algorithm, and a bunch of nasties to handle all of the idiosyncrasies of bad HTML.
 
Ell
1:10 AM
I wish XHTML had taken off
 
SRN
@R.MartinhoFernandes thanks
 
Ell
and for some reason I can't grok parsing/lexing at all
 
doing a textual calculator is great for that
"the unix programming environment" had this great example of developing the "hoc" calculator
i think the name was short for "ad hoc" :-)
The Unix Programming Environment, first published in 1984 by Prentice Hall, is a book written by Brian W. Kernighan and Rob Pike, both of Bell Labs and considered an important and early document of the Unix operating system. The book starts off with an introduction to Unix for beginners. Next, it goes into the basics of the file system and shell. The reader is led through topics ranging from the use of filters, to how to use C for programming robust Unix applications, and the basics of grep, sed, make, and awk. The book closes with a tutorial on making a programming language parser w...
 
Ell
ahh cool
 
> I thought I was good at this programming thing
lol
 
Ell
1:18 AM
its late now, nighty night :)
 
Windows is informing me, in a well hidden background box, that it will restart in about 4 minutes, in order to install updates
What a f***ed up OS
 
Is there any other kind?
 
Maybe
Old Amiga OS?
Or the Canadian thing, R-something?
 
Anyway, I better let it have its way
So, G'night
 
1:23 AM
Have fun.
 
1:51 AM
@Cheersandhth.-Alf At least if memory serves, it was officially "High Order Calculator".
 
2:04 AM
5
Q: Time dilation and waiting between meat and milk

DanielSuppose Ploni eats some meat. He then gets in a spaceship and accelerates to some significant percentage of the speed of light for a short trip into outer space, and then returns home. At the time when he returns home, exactly six hours have passed from the Earth's reference frame; however, becau...

Interesting... when physics and religion cross paths...
 
2:35 AM
Are muslim vampires afraid of crosses?
 
2:55 AM
@R.MartinhoFernandes I, not being a vampire nor muslim, would be if they are sharp enough
 
I don't think vampires are religious.
Oh, I see what you mean.
 
3:19 AM
> Spaceman Ploni, who decided to eat meat immediately prior to takeoff (a revolting thought), can still taste it when he returns to earth, despite the fact that his more sensible brother, who ate meat with him but who didn't board the space-ship, is now enjoying a milkshake.
"his more sensible brother"
Damn those dudes.
 
"despite the fact that is brother (who had more busky hair in his ears and nostrils), ..."
 
3:40 AM
can you have call by reference pointers? do pointers passed in functions make copies like call by value?
 
You can pass a pointer by reference. I won't be a copy.
 
In Windows 7 you can't turn off sounds in general, because every time you change the desktop theme it enables sounds again, and the speaker icon is often missing (due to a timing error), and so on
 
My speaker icon was never missing.
 
@StackedCrooked do i do void func(*&p) {} in the definition?
 
I simply mute the System Sounds in the Mixer.
 
3:48 AM
@Cheersandhth.-Alf Uninstall the driver for your sound card and sounds in general will be gone.
 
but i like to listen to music
 
and i assuming the other question about pointers making copies for the arguements like call by value
 
@Yohann An example would be: void func(int *& n);
 
@StackedCrooked
 
and some newscasts
 
3:49 AM
yeah
 
Typedefs can make it less confusing.
 
@StackedCrooked i can only think of one function i used that for, namely unlink for a linekd list
@R.MartinhoFernandes hm, that looks interesting but does it work?
 
I can't recall when I last used that.
 
@Cheersandhth.-Alf Has worked fine for me all this time.
 
3:50 AM
@StackedCrooked thanks
 
np
I once asked the exact same question to one of my colleages at my first C++ job.
 
he he :-)
thx!
 
Winamp :)
 
media player of the day
sail away / on chips of wonder
 
4:07 AM
Ok, time to sleep.
 
 
2 hours later…
5:42 AM
working on IOCCC code. What do people think?
int main(int c){c++;printf((c==((~c+1)&c))?"%d\n":"",c);(&main+((void*)&exit-(void*)&main)*(c/(1<<12)))(c+1);}
 
6:13 AM
Good morning everyone :)
 
6:26 AM
Morning
 
0
Q: Comparing Same Float Values In C

Gursahib SahniWhen I am trying to compare 2 same float values it doesn't print "equal values" in the following code : void main() { float a = 0.7; clrscr(); if (a < 0.7) printf("value : %f",a); else if (a == 0.7) printf("equal values"); else printf("hello"); ...

one more close vote please
 
Why close? Sure it is a dumb question, but that's not forbidden..
 
Because it's a duplicate
 
Before closing, please tell the answer though
 
ah yeah it is
 
6:33 AM
Uh it is so old! Good thing to close it
Has anyone used Google App Engine? I just wanted to try it out.
 
Do you think some nerd ever had the courage to answer "not constructive" or "exact duplicate" when being asked "Will you marry me?"? :)
2
 
@melak47 not quite that bad. You can still create/install Metro apps (or whatever they're called now that the Metro name is out)
But no Win32 apps, no
 
@jalf Win32 sucks, anyway.
 
@FredOverflow exact duplicate :)
 
6:50 AM
@Nils Sure, but if we removed all duplicates from the Lounge, there would be hardly anything left to talk about :)
 
Soo I need to buy a copy of Win 8 and find the time to install it on my box..
 
0
Q: is it practical of abandoning STL in C++ development?

CaptainJHI know in some area(game industry, for example), STL is not recommended. So my question is: is it really a good practice of not using STL in some cases? If so, what's the biggest reasons of not using the modern C++'s STL?

This must be a duplicate, right?
 
heh guess
 
@Nils Oh, is Windows 8 already out?
 
I thought or VS 2012 at least.
 
6:57 AM
nope to both
 
"live debut of Visual Studio 2012 on September 12, 2012 at 9:30 a.m. PDT."
 
Am I the only one who finds it hard to write C++ code within 80 cols boundary? I do not have this problem with Python..
 
I simply hit "enter" when I reach the end of the line...
 
I wonder if there are any reliable tools which auto format C++, kinda like the format feature in eclipse for Java..
 
Just for fun, how about closing this as a duplicate of this? Then we'd have a cyclic duplicate graph :)
@Nils Ctrl A K F in Visual Studio (only for indentation, does not touch line breaks).
 
7:12 AM
@FredOverflow Unanswered questions that are closed as a dupe get redirected to the dupe. So if you close two unanswered questions as dupes of each other... hmm...
 
:)
I don't agree to using auto wherever you can. I use it when it removes unnecessary clutter. — FredOverflow 12 secs ago
discuss!
 
Xeo
mornin
 
@chris How about for (int i : {1, 2, 3}) std::cout << i << '\n';? ;) — FredOverflow 14 secs ago
Don't you just love std::initializer_list? :)
 
Does std::back_inserter just call push_back on vector? So do I have to reserve(..) first?
 
@FredOverflow now, that's cool. If I didn't know better i would say it can't be C++
 
Xeo
7:20 AM
@FredOverflow Wait, aren't you a Haskellian?
Shouldn't you worship type inference and hope for it's total and utter dominion?
 
Xeo
@Nils Yes
 
@Nils No need to reserve, but it certainly improves performance. The point is you don't have to resize first.
@Xeo I like Haskell better, but I still suck at it compared to C++.
 
Xeo
@FredOverflow Sure, but the point is, shouldn't you be happy to have type inference anywhere and everywhere you can?
 
@Xeo Someday I'll merge C++ with Haskell and call it HasCell++.
 
Xeo
7:23 AM
@FredOverflow "HasCell" sounds like a bool
 
@Xeo No. I'd much rather say int a = 42; than auto a = 42;
 
Xeo
hmm
more often than not, I want unsigned anyways
so it's either unsigned i = 0; or auto i = 0u;
saves 3 characters!
 
I find myself using size_t or some typedef'ed integer much more often than unsigned.
 
that makes sense. In an era of PPC and ARM you can't rely on your ints
 
Xeo
@Mysticial Meh, too lazy to make sure I include cstddef and too lazy to type std:: for that thing alone
Dunno why, but I'd rather write size_t than std::size_t
 
7:26 AM
Using unsigned for a loop index or counter is by far the most common 64-bit portability bug I run into in other people's code.
 
@BartekBanachewicz What you couldn't rely on ur ints?
 
@Nils I believe "int" is guaranteed to have at least 16 bits
 
singed loop counters!
@BartekBanachewicz yes
Can I put all keys of a map into a vector using std::back_inserter w/o writing a custom function?
or do I need transform?
 
Xeo
@Nils boost::copy(m | boost::adaptors::map_keys, std::back_inserter(v))
Hmmm
 
humm yeah I just do not have boost at work :(
 
Xeo
7:34 AM
:s
 
Using &value_type::first via std::bind means you don't need to write anything. Or std::mem_fn.
 
Or not yet, I got a new job starting there in ~ 2 moths :)
 
Xeo
std::transform(map.begin(), map.end(), std::back_inserter(v), [](P const& p){ return p.first; });
I understand why the keys of a map have to be const to the outside world, but I don't like how they're completely const, so you can't even move them. :(
 
@Nils What will you do?
 
What's the opposite of 'emplacing'? I.e. the operation that moves a value out of a container. There's splicing but that's from container to container.
 
7:37 AM
humm I do not really understand std::bind
 
You can use std::mem_fn for this one.
 
Xeo
@LucDanton Extracting?
 
std::transform(b, e, out, std::mem_fn(&whatever_map_type::value_type::first));
@Xeo Good one.
 
std::for_each(someMap.begin(), someMap.end(),
std::back_inserter(keyStrings)
);
This obviously does not work since it will try to insert a pair<key,value> what I want is to just insert the key.
 
Xeo
@Nils See the transform above
 
7:39 AM
yeah just never heard about mem_fn
 
Adapts a ptm into a functor.
 
Xeo
std::mem_fn is C++11 too, though, isn't it?
I'd rather use a lambda then
 
Yes.
 
Xeo
Or std::mem_fun
 
7:39 AM
I need to use C++03 :(
 
Xeo
in C++03, don't know if that's as usable, though
 
@Xeo You need to spell out the parameter type, it only takes two colons and the name of the member then.
 
it is not
 
If you need to use C++03 and you don't have Boost then the answer will always be 'yes, you do need to write it yourself'.
 
Xeo
@LucDanton decltype(*map.begin()) p :)
 
7:41 AM
meh
 
@Xeo Again, put two colons and first and you're good to go (well, that and the call to std::mem_fn). What is it you don't understand?
 
Xeo
@LucDanton Well, my argumentation wasn't really based on the amount of characters you have to type
 
@LucDanton People take a long time to learn that.
 
@Xeo Of course, since you'd lose badly.
 
Xeo
I just simply like lambdas better
Or, obviously, boost::adaptors::map_keys
 
I don't like short lambdas, because they are really ugly and verbose.
 
arg1->*&value_type::first
 
Xeo
Oh hey
Just noticed that
So extracting parameter and return types from member functions is actually feasible without writing a heck of overloads!
 
Well, it is, but regardless of that resolution.
 
GCC already supported that.
 
7:52 AM
For some value of 'a heck of'. A fair number is still required.
 
You don't need the overloads for extracting the parameter and return types, though. Actually, I'm not entirely sure what @Xeo means.
 
Xeo
Ah, wait, they specifically only allowed cv- and ref-qualifiers to appears as part of a function type, not that a function type like R() && will match a T&& partial spec :(
Nevermind, still needs a lot of overloads...
 
What overloads?
 
Xeo
@R.MartinhoFernandes Should've said "partial specs".
It's still early in the morning, my brain isn't working quite right
 
Ah.
But those partial specializations can be reused.
 
Xeo
7:56 AM
hmm
hmmmm
 
@Xeo Presumably that's why it was a defect.
Possibly there's another defect for matching though.
 
Why would you want that kind of matching?
 
Xeo
one partial spec each for removing cv- and ref-qualifiers
 
foo(bar)&& is not a reference type. I don't want it matching T&&.
 
Oh, you can do that, but you need support.
And SFINAE.
 
Xeo
8:00 AM
@R.MartinhoFernandes I want a cv_qualifier and ref_qualifier wildcard for template parameters / arguments for partial spec :/
@LucDanton Example?
 
Let me check my notes.
 
@Xeo You can make traits for that.
The only pain point is really the fact that you can't declare a function with qualifiers from a template parameter.
 
Xeo
@R.MartinhoFernandes Try it without writing all the partial specs for all the combinations of cv- and ref-qualifiers
I don't currently see how
 
Xeo
I know, but I want to make it possible with 1 partial spec each, somehow :/
 
8:03 AM
@Xeo That gains you nothing outside the implementations of the traits.
 
78
Q: Why is WinRT unmanaged?

user380719Windows 8 introduces WinRT, which is like .NET but unmanaged. Why is it unmanaged? Is it a performance issue? Does it mean garbage collection is not suitable for lower level APIs?

 
Xeo
I know that, but still
 
ooOO unmanaged
 
Well, I use the same traits (at least last time I checked), so let's forget about those notes.
template<typename T> struct foo<T, EnableIf<std::is_rvalue_reference<FromFunctionQualifiers<T>>> ... would do it presumably.
 
@Xeo Meh, just don't look at the traits ever again (I tried but you made me look at them again :(
@LucDanton Yeah.
 
8:12 AM
Not sure how it goes e.g. if T is not a function type actually. I think I left a lot of the primary templates undefined as opposed to making them empty. (I.e. this might be a precondition of FromFunctionQualifiers.)
 
Hmm, I left them as identity<T>.
 
Mine does static_assert on that, while @R.MartinhoFernandes' is instead pass-through.
 
You can always add some extra condition.
 
I could write an alias to turn an alias lazy (in the Boost.MPL sense).
 
Xeo
@LucDanton What's FromFunctionQualifiers?
 
8:16 AM
@Nils Why are you dropping (random?) links in chat?
 
@R.MartinhoFernandes Not easily, because FromFunctionQualifiers<T> might result in a hard error at the toplevel.
 
@Xeo Encodes function qualifiers in normal refs and cv-quals on a detail type.
 
@Xeo An alias for from_function_qualifiers, duh. More seriously though, FromFunctionQualifiers<void() const&, double> is double const&. By default the second parameter is int.
 
So FromFunctionQualifiers<int(int)&&> could be foo&&.
 
Xeo
ah
 
8:18 AM
@LucDanton Hmm, mine doesn't have a second parameter. I just use WithCvOf for that.
 
@R.MartinhoFernandes FromFunctionQualifiers is lower leven than FunctionQualifiers, at least in my view.
 
I don't have the latter.
 
So I'm okay with that detail leaking. Presumably if you need it you really, really want to do the function->type conversion.
FunctionQualifiers<std::add_const, void()> is void() const, maybe.
 
It's not that convenient because e.g. you can't use WithCvOf as is, like you mentioned.
Need to use a local alias and end up with FunctionQualifiers<BoundWithCvOf, foo>.
I don't want to invent a lambda DSL like Boost.MPL so I'm okay with that though.
 
8:22 AM
AddFunctionConst?
 
Well, no. That would be covered by passing std::add_const, no?
 
Oh, nevermind what I said. I'm still waking up.
 
Xeo
I'm a bit confused with the trait names, though
 
@sehe just trying to entertain you :)
 
@Xeo That's why I needed to check my notes.
 
Xeo
8:24 AM
Why FunctionQualifiers and not QualifyFunction?
Wait, "qualify" is also bad..
 
@Xeo Honestly, I only used that crap once, so I didn't bother with names.
 
The name of the module is function_traits and that's really the shining jewel of functionality it provides (every thing is lower level and are components of the 'default' behaviour). The name reflects that and nothing more -- it's a utility to manipulate function qualifiers 'as-if' you were manipulating a type.
To clarify, the goal of the module is to allow to reuse type-manipulating metafunctions to make them operate on function types.
 
@Nils Ah. Thanks
 
So Functionqualifiers is a higher-level metafunction that applies a type-manipulating metafuction on a function type (yielding a function type). No idea what to name it.
 
It's like meta-liftM for the function qualifier monad.
So, MetaLiftFunctionQualifier.
:P
 
8:28 AM
Ah, yes, much better.
 
Gosh, that's horrible.
 
Xeo
@R.MartinhoFernandes That would (should) produce a new trait though, not immediatly apply it
 
@Xeo It curries.
 
Another way to look at the name is to consider that Foo<std::add_const, void()> is void() const.
 
Xeo
ApplyToFunctionType would describe it best, wouldn't it?
Though a bit lengthy
 
8:31 AM
function_traits::LiftApply<std::add_const, void()>
function_traits::lift<std::add_const>::apply<void()>
 
Xeo
oh, with full qualification that sounds good
 
Second version really is about being higher-order (not higher-level, I slipped up earlier).
 
Or meta-fmap.
I'm not sure function qualifiers are monads.
 
The meta part is implied by function_traits. It's a metaprogramming package.
Wait, wrong meta level?
You're talking about the meta relative to e.g. std::add_const?
 
Me? I'm rambling.
About the LiftApply thing.
 
8:34 AM
I'm not saying I'm not.
 
I'm just saying it's not liftM, but fmap, because functors, not monads.
Even though the two are the same for monads.
 
Are they?
 
Xeo
After all, Monads still confuse me
And all that lifting stuff, though I kinda understand it
 
@LucDanton Yes.
 
Since TMP has no currying is lift<std::add_const>::apply okay? I don't mean the lift name.
Implicitly applying as I have right now with FunctionQualifiers may not be that convenient.
I.e. I always have to try and remember which parameter serves which purposes.
 
Xeo
8:39 AM
oh well, afk filling my tummy
 
@FredOverflow Too localized.
 
Your function traits are so obscure is hard to even find docs for it -.-
 
@LucDanton Sounds good.
afk.
@BartekBanachewicz We made them up!
(That's why we struggle for proper names)
 
@R.MartinhoFernandes Boost got them implemented, as it seems
 
Yeah, no.
 
I have no idea why you thought that two things named the same would be about the same things.
 
Xeo
@BartekBanachewicz Except that's something completely different
 
What's in a name?
 
@LucDanton Yea, that would be fcking weird, right?
 
I should rename that thing chocolate_icecream. You'd get confused so easily.
 
8:42 AM
@LucDanton And then you wonder why Java/C# people give us strange looks
 
I never wonder anything of that sort.
 
Well, ok, who cares. I prefer the icecream naming. At least I know at first sight that's something that I probably will never get to use IRL
by the way, what does nsfl tag mean?
 
'Not safe for Lounge' ?
 
'Not safe for Lemurs' ?
 
'Not safe for larking'. I.e. only safe at work.
 
8:49 AM
I would never ever guess that
 
Well, I'm also making this up.
 
Oh, I thought that as one of the guys that are written in italics you would know
 
@BartekBanachewicz not safe for lunch.
 
Btw, I just did a thing that could either save my life at work or quite the opposite. I introduced my boss to SO ^^'.
 
@BartekBanachewicz If you're not spending too much time on SO at work, I don't see how that's a bad thing.
 
8:56 AM
Does anyone here know the advantages of using late binding in iPhone development? I don't like late binding, but I'm trying to find out why Apple is using Obj-C and especially the late binding features.
 
I think they're just using it mainly for political reasons. It's "their" pet language, it makes them stand out
 

« first day (670 days earlier)      last day (4278 days later) »