« first day (863 days earlier)      last day (4102 days later) » 

user142019
2:00 PM
reinterpret_cast from unsigned char const* to R(*)(Args...) seems to work.
 
user142019
Even though I cast away constness. Or don't I?
 
There are no objects of type R(Args...)
 
user142019
Oh of course.
 
user142019
lolwotwatwut
 
2:03 PM
lol
 
user142019
@TonyTheLion on the toilet.
 
good answer
 
user1357851
Cuddled by the puppies? That would imply the puppies are bigger than you ...
 
user1357851
 
2:18 PM
hi all
 
is there the possibility of having an abstract class that inherit from a non abstract class?
 
New here? Do us a favour, and read this : loungecpp.wikidot.com/owners%3Anewbie-hints
 
@nicolagenesin well doing that would make your abstract class non-abstract wouldn't it?
so that's a silly thing to do
 
user1357851
@nicolagenesin that would be a rather stupid design, don't you think?
 
2:20 PM
@TonyTheLion nope
 
@nicolagenesin Yes, just add a pure virtual function.
 
@TonyTheLion Of course not.
 
@Telkitty nope
 
It's not a silly thing to do.
 
@sehe what?
 
user1357851
2:21 PM
@sehe example, please
 
@TonyTheLion nope
 
an abstract class in C++ has at least one pure virtual function.
 
@R.MartinhoFernandes virtual class SomeClass {
 
the bases are irrelevant, except if one of them adds a pure virtual function which has not been overridden.
 
Why am I always wrong with the most silly things?
 
2:21 PM
but if one exists in the current class, it must be abstract, irrelevant of it's bases.
 
user142019
@DeadMG or a pure virtual dtor.
 
user1357851
But why would you want to make the child class of a non abstract class, abstract?
 
@Zoidberg Which is a pure virtual function.
 
user142019
Nah.
 
2:24 PM
@Telkitty That question has the same answer as as "Why would you want to make a class abstract?"
 
user142019
> Because abstract classes are good OOPS design!
 
as in, "OOPS, I shouldn't have designed it that way."
 
user1357851
A class is abstract because it should not be instantiated. Because some states are not defined. Those states are defined in the children classes.
 
    template <typename Tag>
    struct not_quite_the_same_traits : std::char_traits<char> {};
    template <typename Tag>
    using strong_string_alias = std::basic_string<char, not_quite_the_same_traits<Tag>>;

    using vanilla_string = std::string;
    using strawberry_string = strong_string_alias<struct strawberry>;
    using caramel_string = strong_string_alias<struct caramel>;
    using chocolate_string = strong_string_alias<struct chocolate>;
 
lol
 
user142019
2:26 PM
lol
 
@Telkitty definited?
 
@Telkitty Wrong. A class is abstract because it does not provide a full implementation of its interface. It is not about should or should not be instantiated. That's just a side-effect.
 
user1357851
@R.MartinhoFernandes that's why it is a stupid idea to extend a non abstract class to an abstract class
 
Hi.
 
You need to use logic to reach conclusions from premises.
3
 
2:28 PM
lol
 
If I derive from a class and add a pure virtual function I am extending its interface.
 
hi, one small Q, is there a C++11 built in suffix for string, aka auto x = "bla"s + my_std_string; will work because it will figure out that bla is std::string and not char array
 
I have a need to iterate over code points in UTF-8 string stored in std::string instance so that I can escape characters for JSON. Now, I have only Boost 1.42 and Poco available. What do I do? :)
 
@NoSenseEtAl No built-in. Easy to make your own with UDLs.
 
...beside implementing the UTF-8 parsing myself.
 
2:30 PM
Can I just ask, whats so great about UTF-16?
 
@wilx I think Poco has something.
 
My friends were talking about it.
 
@R.MartinhoFernandes nah, I just wanted to get rid of that small iritation :D
 
@GamesBrainiac The fact that it interoperates nicely with UTF-16.
 
@NoSenseEtAl Would work in C++03 anyway.
 
2:30 PM
the bits per character
 
@R.MartinhoFernandes I am looking at its docs but I cannot find anything.
 
@DeadMG what ?
 
@wilx convert it to utf-16 and iterate over wchar_t
 
@NoSenseEtAl "blah" + std::string().
gives back std::string.
 
@R.MartinhoFernandes lol
 
2:30 PM
@Abyx That's not what he wants.
 
the only time + doesn't work is when doing "blah" + "lols"
 
@Abyx that won't be codepoints
 
@Abyx I would consider this as the last option. It would be very slow.
 
as long as at least one operand is std::string, then it works fine.
 
@wilx It's also not what you asked for.
 
2:31 PM
Indeed.
 
JSON uses "\u four-hex-digits" - isn't it utf-16 ?
 
user1357851
@R.MartinhoFernandes a: concrete class. b, abstract, inherited from a. c & d concrete inherited from b. You might as well cut down b
 
Poco has static void properties(int ch, CharacterProperties & props); but I cannot find a way to parse the std::string as UTF-8 bytes.
 
@Telkitty Not if you want to use the common interface provided by c & d but not a.
 
user142019
2:32 PM
@Telkitty you might as well completely rethink your design.
 
@Telkitty I don't see why. Now add e that derives from a but not b. Cutting out b loses expressiveness.
 
@DeadMG "blah" + "trolls" doesn't seem to work either
 
@DeadMG you are right, still I it is irritating when you have 2 char arrays
 
@NoSenseEtAl Not really, since "blah" "lols" works just fine.
 
@Abyx Oh, maybe. That's what JavaScript uses IIRC :/
 
2:33 PM
@DeadMG hmm, didnt know that... tnx...
 
> To escape an extended character that is not in the Basic Multilingual Plane, the character is represented as a twelve-character sequence, encoding the UTF-16 surrogate pair. So, for example, a string containing only the G clef character (U+1D11E) may be represented as "\uD834\uDD1E".
 
^ I've been looking at this screen for ~10 minutes now
 
@Abyx You're right.
 
@ScottW shhh. Or I'll need to roast you too :)
Anyways, I'm waiting to be able to REBOOT just so that Windows will stop talking gibberish to me
@ScottW Yeah. I surprised Cicada with a strong response earlier today. She hasn't been seen around since then, I think
 
@wilx So, yeah, if you're on Windows, just convert to wchar_t with the stdlib stuff or whatever and iterate that. If you are not on Windows... dunno, maybe POCO has a UTF-16 thingy.
 
2:37 PM
Hmm.
Thanks.
 
@R.MartinhoFernandes I have seen code that does this ... in maybe 8 lines of code. It's not actually that complicated (as long as you don't care what the encoded data means I guess)?
@ScottW Nah. I feel bad enough already. I'm sure you can find it
@ScottW You managed to make FB suck more?
"Vind ik leuk!" <-- lol
 
@sehe Oh, I have seen code that does that too ;)
 
inline std::wstring bytes2str(const std::string& bytes, int codePage = CP_ACP)
{
    std::wstring str;
    auto len = ::MultiByteToWideChar(codePage, 0, &bytes[0], bytes.size(), nullptr, 0);
    if (len > 0)
    {
        str.resize(len);
        ::MultiByteToWideChar(codePage, 0, &bytes[0], bytes.size(), &str[0], len);
    }
    return str;
}
^ I use this
stdlib stuff is just useless %)
 
@R.MartinhoFernandes I mean like, would you advise against handcoding it? It appears that PoCo is a bit of a heavy dependency for just this to me
 
Unless it's straight up copy-paste, yes.
 
2:41 PM
Obviously
 
@sehe He already has Poco as a dependency.
@sehe I messed one bit in the masks of my UTF-8 encoder. It worked just fine, except for a short range I didn't happen to test. Someone else hit it accidentally when testing grapheme clusters.
 
@R.MartinhoFernandes Awesome war story. I had a bug like that in my "big project of last year". I was ashamed to admit that I decided to do it without the (obvious) unit test
@R.MartinhoFernandes Aha.
It was only 1 function in a 27kLOC code base, but still
 
Well, in my case it was one bit.
 
Whyyyyyyyyyyyy is Win7 rescanning the whole source tree after copying? I'm still looking at the exact same screen
And of course, McAfee is dutifully giving every single file another scan
@R.MartinhoFernandes You win
 
ARgfreheh. Stream manipulators, how I hate thyselves.
So, what's the boost class to save and restore stream state?
 
2:48 PM
@R.MartinhoFernandes "thyselves" - mallformed reflexive
 
@R.MartinhoFernandes It should be "thee".
 
@ScottW So thought someone else
 
user image
8
Reminded me of @Cat
 
FFS, stop correcting my Elder English. It's older than the Old English you guys know, ok?
 
@R.MartinhoFernandes lol robot, you need to archive some of the languages you learned thousands of years ago
set the invalid flag
 
2:50 PM
@Telkitty Re:
(removed)
(removed)
lol
lol
@TonyTheLion Crop fail. Or artsy composition. What is it
 
user1357851
@sehe It is possible. But let's not lose sleep over it :p
 
@sehe it's a comic
 
Is there a site out there that discusses what might come post C++11? I'm hoping modules can make it in, eventually...
 
@kfmfe04 isocpp.org
 
@TonyTheLion Wokay. Crop fail then
 
2:51 PM
@TonyTheLion ty
 
@kfmfe04 Keep an eye out on the std-proposals mailing list and the open-std papers open-std.org/jtc1/sc22/wg21/docs/papers/2013 (and open-std.org/jtc1/sc22/wg21/docs/papers/2012, I guess).
 
@TonyTheLion lol
 
meh modules... we don't have C++11 in VC++11 yet.
 
@R.MartinhoFernandes great :^) bookmarked
 
2:53 PM
@sehe lol - unfortunately, my skills aren't good enough to contribute!
 
Ah, screw it, I'll just set the flags on a stringstream, format everything there, and then feed the result directly to the target stream.
 
@R.MartinhoFernandes Said 378247 C++ devs before you
 
hi all
 
2:57 PM
is there the possibility of having an abstract class that inherit from a non abstract class?
 
Again?
37 mins ago, by R. Martinho Fernandes
@nicolagenesin Yes, just add a pure virtual function.
 
@nicolagenesin uh
 
@R.MartinhoFernandes I thought the chat glitched and sent me back in time
 
thanks,i didn't know it was correct logically
 
Quick, without checking the docs, what does std::uppercase do?
 
3:00 PM
uh
 
Sigh, iostreams.
 
@R.MartinhoFernandes returns true if character is uppercase?
 
Nope. It's a stream manipulator.
No, it does not make the stream output everything in uppercase.
 
C++ stdlib sucks.
 
only numbers :P
 
3:01 PM
All it does is set hex output to use A-F instead of a-f.
 
what about E?
 
@R.MartinhoFernandes what about X ?
 
@Abyx There is no X in hex output.
 
well... printf > iostreams.
 
@Abyx no.
L2C++
 
3:03 PM
wat?
 
sprintf sucks because I need to know the size of the output before asking sprintf to produce said output.
 
@R.MartinhoFernandes If you tell it to produce the 0x prefix, uppercase will make it 0X.
 
It's a chicken-and-printf scenario.
 
are you guys interesting today?
 
@R.MartinhoFernandes snprintf (if you insist on going that route).
 
3:04 PM
@LightnessRacesinOrbit no.
 
@LightnessRacesinOrbit Never have been, never will be.
 
@JerryCoffin That only prevents it overflowing some buffer. It does not mean I know how big that buffer needs to be. (looping and retrying is annoying as heck)
@JerryCoffin Oh, how do you tell it to do that?
Not that I need it, but curious.
 
@R.MartinhoFernandes It will tell you the necessary buffer length, if you ask it nicely.
 
@R.MartinhoFernandes we just need fprintf and a memory stream
 
3:06 PM
well, i thought you was doing some entertaining stuff right there
nothing's going on xD
 
@JerryCoffin Oh, you're right. Cool, learned something.
 
@R.MartinhoFernandes Can't remember offhand, but I've done it so I'm fairly sure it's possible.
 
@R.MartinhoFernandes asprintf will actually allocate a buffer for you
 
@sehe That's not portable enough :/
 
@R.MartinhoFernandes showbase - en.cppreference.com/w/cpp/io/manip/showbase
 
3:10 PM
Anyway, I got it with the stringstream scratch space. This is just some debug output anyway.
Lovely <U+006A U+F76A>
 
Hospitals... So much waiting
 
Do you work as a waiter in a hospital?
 
And why do kids always look at me like I am going to rip them apart?
no... I am in one
 
Kids are afraid of pirates. It's normal.
 
When kids look at me their moms tell them to not look at that weird person.
 
3:17 PM
no doubt I will just be given a slip of paper and charged for the honor of having my time wasted
Kids, f... Erm..
And why does chat not have a decent mobile site? How hard can it be?
 
Stop kicking the chair spawn! I will end you!
 
@thecoshman Because you're a pirate?
 
@thecoshman Mobile site uses API. API lacks features => crappy mobile site.
 
3:33 PM
Wait, it will fail with templates :/
 
@R.MartinhoFernandes don't worry - it's also frequently not what you'd want, anyways
 
Hmm, a colleague of mine sent me a question, and since it's one of those "philosophical" questions, I figured I'd post it here.
> how would you name a library(DLL) whose purpose is to manage a slave process, handling RPC between the master and slave as well as the slave's lifetime?
 
@EtiennedeMartel I'd call it a loader image. Or a host dll (service host, application host - yeah that one sounds right)
@thecoshman They don't trust you, for the obvious reasons
 
@thecoshman They saw you rip that kid apart last time.
 
3:47 PM
hmm
I think that I accidentally wrote my analyzer in the perfect fashion for dealing with LLVM declarations.
 
"Accidentally"
 
well, I didn't even think about it
but now that I looked into the problem, it appears that I already solved it without thinking about it
well, tough to be me in this respect
 
Puppy should do an AmA
 
@ScottW I was thinking the same thing.
 
3:52 PM
@R.MartinhoFernandes Isn't that just called "Chatting" around here?
 
@R.MartinhoFernandes Nice. You could make it more general (if that makes sense) stacked-crooked.com/view?id=bc2104cc494ac7acfb2e3938ba4d85ec
@R.MartinhoFernandes Announced media Appearance?
 
"Ask me Anything".
 
You'd never participate there :)
 
considering that I can already be asked anything, it's a moot point anyways
 
Yeah, but that's an entirely different thing from inviting everybody to ask you anything
 
3:57 PM
yeah, in one, I make an explicit invitation and set a time and inconvenience everybody, and in the other, it's all the time, on demand, whenever it's mutually convenient.
 
go ahead :) ignore the point
 
I don't think I see it
 
test/normalization.c++:38: nfc.storage() == nfc_expected failed for:
        <U+00E0 U+05AE U+1D244 U+0315 U+0062>
        ==
        <U+0061 U+05AE U+1D244 U+0300 U+0315 U+0062>
 
the only difference is scheduling, and the current solution involves maximally flexible and convenient scheduling.
 
OMG this is soooooooo much better than failed for: {?} == {?}.
 
4:00 PM
eh, debug mode gives me different results to release mode
 
That sockpupetting stuff was hilarious.
 
UB much?
 
@R.MartinhoFernandes are you saying you like clang error reports now? Or did GCC change? (Oh wait: you devised an evil macro to make life easier)
 
@sehe That's output from a test case.
 
Wokay. What test framework is that (if any)?
 
4:05 PM
@sehe No macros involved. I just started using strawberry strings instead of vanilla strings :P
@sehe Catch.
 
@R.MartinhoFernandes I prefer vanilla, honestly.
 
@EtiennedeMartel failed for: {?} == {?}?
Not very helpful.
 
@R.MartinhoFernandes I meant, if we're talking about flavors, I like vanilla more than strawberry.
 
@R.MartinhoFernandes Oh. That seems way cool. You mean that Catch was already helpfully dumping strings, but you made it dump the raw bytes
@EtiennedeMartel ...
 
@sehe Right.
 
4:08 PM
@EtiennedeMartel Strawberry is okay...
 
@sehe Although, strawberry yogurt is nice.
 
It isn't. You are wrong.
 
Is not
Is so
Is not
etc.
 
Bonkers.
 
4:14 PM
Yup
This is an interesting bit of maths
 
4:29 PM
Ergh, cold coffee.
 
robot
how do I get rid of those "multiple head" thingies in my repo
I looked around in Tortoise and I don't see much about it
 
@DeadMG Merge.
 
huh
how do I do that?
 
You take the head you want to keep, and you merge the other one in it.
 
4:40 PM
(I'm assuming you're on Hg)
 
In the RFC 4627 (JSON), they say that forward slash is a special character that needs escaping. Is that true/do I understand it correctly?
 
@wilx Yes.
They usually call it a "solidus" though
 
right
well it certainly doesn't bitch about multiple heads anymore
and it doesn't seem to have broken anything
 
You can check the log to make sure.
 
heel goed
maar veel te druk
 
4:45 PM
@EtiennedeMartel Whenever there was a merge conflict, I took local.#
and I'm pretty sure that every file of use was changed between revision 62 and revision 18, 18 months ago.
 
lol. "Merging" redefined
 
Puppy merges with a fucking shotgun.
 
This is what my grandma would call "pruning the old branches". Not "merging"
 
hg doesn't use hashes to reference commits ?
 
It can. I believe it has those and user-friendly (gah) revision numbers
 
4:48 PM
I wonder how it handles that
Seems quite impossible for a DVCS to handle sequential revision numbers
Unless it applies only for a particular scheme with a central repository
 
> My problem is that I use the conceal feature in c/c++ to replace operations like && ||, etc for unicode ⋀ ⋁ etc, and I also use concel in html to replace text entities like "&ccedil;" to "ç". -- oh my
@ereOn It is only a problem when the numbers need to have inter-branch relevance. If that's not needed, everything is peaches. But merging/ rebaseing/ cherry picking etc. may change the revision numbers.
 
don't you mean inter branch?
 
yup. Also don't take my word for it. I've used Hg, Darcs, Monotone, Bazaar (for years). But I've settled on Git over the last 3+ years so my memory isn't to clear
 
Seems like a lot of trouble just to have sequential revision numbers (which don't bring much imho)
 
@ereOn Hey, I'm not the one inventing this shit :)
 
4:52 PM
@sehe: And I don't blame you for any of it ;)
Just wondering why they took some time to implement that.
 
I like it
when you say "revision #AFEE908708" then I'm like "Where the fuck is that?"
but if you say "Revision 43" I know that was 20-odd commits ago and I can find it easily
 
Or you simply copy and paste the hash into some tool that finds the commit for you.
 
Well I think this is a false problem : you only have to compare revisions that are working builds, and if so you can just tag them, with whatever you want (date, increasing number, and so on). Tagging in Git/Hg is cheap.
 
@ereOn Depending on implementation details, it may already be there, for free
 
Coming from SVN, I actually used to think the same way regarding revisions numbers, but I have been using git for years now and I never missed it.
 
4:55 PM
@DeadMG Thing is "Revision 43" could be anything next month, and there is absolutely no guarantee that "Revision 43" has not been tampered with.
Contrast that with rev sha af8da1992f814f309 - which conveys just as much meaning as "43" - because it has all those features
@ereOn I've even used CVS before that. The 'nested revision numbers' were so error prone to work with. Sigh
 
@sehe: I never used it. Well, I fetched a repository once but never had to commit in it.
 
@DeadMG git branch --contains hash
 
I heard commit could be half-successful (or half-failure) in CVS
 
@ereOn God bless your innocent soul
 
@sehe Fuck command lines.
if there's not a button for it in TortoiseHg, the feature doesn't exist.
 
4:58 PM
@sehe: I'm no innocent : had to use Visual SourceSafe for 2 years.
And trust me when I say I would have killed to use CVS instead of that piece of junk.
 
@ereOn Ah well, not exactly. A commit didn't actually exist. Each file was, in a way, it's own repository. So, you'd have version 34 of fileA.txt and 789 of fileB.txt
 
I had to make a git-vss command to be able to work properly.
 
@ereOn Har har. I'm still using SourceSafe at bloddy work. Needless to say, I work with Git locally
 
@sehe Did you just not get to match up files at a point in time?
 
@ereOn Heyhey. I have that too. Anything worth sharing?
 

« first day (863 days earlier)      last day (4102 days later) »