« first day (1136 days earlier)      last day (3821 days later) » 

user1804599
12:00 PM
lou.ng/e
 
lol, url hacking like a boss :P
 
lou.ng/e/c/c++
 
user1804599
loun.ge is not available.
 
no domain registration is free
 
user1804599
loung.ec/xx
 
user1804599
12:02 PM
loungese.cx
 
inb4 goat.se/aplusplus
 
user1804599
Buy .c++ TLD.
 
Welp strongest hash is salted SHA-512
Whatever
 
bcrypt?
 
user1804599
Does slicing fix the vptr?
 
12:08 PM
In Apache Directory Server
 
@rightfold The vptr does not need to be fixed.
 
Maybe I'll figure out plugins later
 
@DeadMG it doesn't?
 
nope.
 
what will the vptr functions point to in the sliced copy?
 
12:10 PM
the concrete type, what else?
I don't get why people find slicing so confusing.
 
user1804599
@DeadMG So this is UB?
 
there's nothing special about slicing.
it's just a quirk of overload resolution.
 
user1804599
OOOh right.
 
@rightfold No, why would it be?
 
Xeo
not really OR, just conversion rules, really
 
user1804599
12:11 PM
It’s just the copy ctor of B.
 
user1804599
It initialises the vptr before copying over all the non-static data members.
 
@rightfold Exactly as it would do for a regular copy.
hmm, now that you mention it, I might need to fix something w.r.t. that in Wide...
not that I support calling virtual functions anyway.
 
Ah, so vtable isn't copied.
 
can't be.
that would be illegal.
 
Xeo
vtable entries are only adjusted by every concrete class itself. a B will only adjust the vtable to contain the entries to its functions
 
12:14 PM
when you have a concrete B object, then any virtual function on it must go through to B's virtual functions. Must must must.
 
Saying there's nothing special about slicing didn't help me realize that at all.
 
user1804599
Thank you, Puppy, for helping me understand slicing.
 
well, it's exactly the same as if you called B's constructor with an int or a string or anything, at all, ever.
the constructor arguments cannot affect the vtable.
 
user1804599
I just acquired a new slice of knowledge about C++.
 
there are only two ways to get bad results with virtual functions
 
12:15 PM
dat pun
 
the first is to start calling virtual functions from constructor/destructor
and the second is to start memcpy()ing around objects with virtual functions i.e. UB (and of course any other source of UB)
 
Xeo
@DeadMG If you understand what I wrote above, that isn't really "bad results" - only if the function is pure-virtual
 
hmm
 
@rightfold Another bit of hate
 
@Xeo no, also when it does something meaningful in the context of further initialization in constructor
 
12:17 PM
well, I think it can be surprising results- people seem to expect to me that you get the most derived class implementation
and I personally would never do it
 
Xeo
I didn't mean you personally with that "you".
 
yeah, I know.
 
@DeadMG yeah, it's completely unreadable
 
Xeo
(What was the proper name for that use of "you"?)
 
lol, I'm lagging
 
12:19 PM
@Xeo one, oh wait, you mean something else (I mean you you)
 
Xeo
@StackedCrooked "indirect you" or something
dunno
 
I read that it's bad writing style.
Because it can be confusing.
"You would think this is secure" is better written as "I would think this is secure". Maybe this is a bad example.
 
Xeo
Blame English
 
2
A: Manipulating one of the values of a vector of pairs in C++

M M.You can use a lambda function as same as this: transform(PMF.begin(), PMF.end(), PMF.begin(), [count](const pair<unsigned char, double> &x) { return make_pair(x.first, x.second/count); }); or for_each(PMF.begin(), PMF.end...

haha, this guy even copies my typos
 
user1804599
12:22 PM
@CatPlusPlus It’s lovely.
 
Xeo
@bamboon I saw that
lol'd
 
I might sound a bit crazy, but I think I'll actually do some work. Bye!
 
Xeo
Freak.
 
Weirdo
 
@R.MartinhoFernandes found the problem:
 
12:40 PM
one of the problems with 11 and 12 being so similar is that it's hard to see at a glance which one is running.
 
yay, my openid is borked
 
@R.MartinhoFernandes
constexpr bool foo(const int) { return true; }
constexpr void bar(const int a) { static_assert(foo(a), "fails!");}
bar(2);
static_assert expression is not an integral constant expression: foo(a)
 
then that's a bug in your compiler
 
yep ^^
although I don't know how constexpr propagates
inside bar a is const int
and I cannot say const constexpr int to force a to be a constant expr
I mean, the function won't work if I call it with an a that is not constexpr, and I don't know if that is allowed
 
Xeo
@DeadMG No?
You can't derive a constant expression from a parameter value
You'd need constexpr parameters for that
 
12:56 PM
there are no constexpr parameters :(
 
Xeo
Exactly
 
and I want to deal with const char* so I can't use template arguments either :/
 
@gnzlbg That's irrelevant.
Arguments are never constant expressions.
 
but template parameters are
 
1:00 PM
I can pass the chars as template arguments and use them, but then im limited to 3 chars unless I use metaparse
 
user1804599
F# records are funky.
 
Xeo
@R.MartinhoFernandes Here's an example where I find the distinction between parameter and argument rather important.
 
@gnzlbg You can pass them as regular arguments, too vOv
Or were you trying to make return types depend on values of arguments?
 
Xeo
The argument to bar surely can be a constant expression (and is, in the example - 2). However, the parameter can never be.
 
Nope, i just want to use them in a static_assert.
 
1:01 PM
Yeah, not gonna work. constexpr is not what you think it is.
 
@Xeo but then, any constexpr function that I call from within another constexpr function and pass some arguments will be evaluated at run-time because the arguments can never be constexpr? but then I can recurse with constexpr...
 
2 hours ago, by R. Martinho Fernandes
@TonyTheLion It's nothing else than a marker for "this function can be used where a constant expression is expected".
It's definitely not "this function is a compile-time function".
@Cat why does TC say "You have 2 active projects with 1 build configuration."?
 
Root project counts as a project
Only build configs matter for licensing though
 
Oh. Ok.
Are you still planning to apply for the OSS license?
 
We'll see
 
Xeo
1:09 PM
@gnzlbg Sure you can recurse, but only the final result of the call can be used as a constant expression. The function can still be evaluated at runtime without problems.
ahahaha, the flag
 
What flag
 
@Xeo Sounds like the person that lost write access didn't like it.
 
Xeo
@CatPlusPlus Already invalidated?
 
@Xeo yep, if I use the function argument inside a static_assert the function cannot be evaluated at runtime anymore
 
You can just throw if your condition isn't met. You get a failure if needed at compile-time (throwing is not a core constant expression), and you get an exception if needed at runtime.
 
Xeo
1:11 PM
^
return !foo(a) ? throw blah : /* normal path */;
 
I see, thanks! TIL a lot ^^
 
Xeo
Ugh /cc @R.MartinhoFernandes
 
user1804599
throw expressions should be of type bottom.
 
throw my arse!
 
user1804599
Or be statements.
 
1:22 PM
@Xeo At least he made it a non-deducible context.
 
Xeo
@Stacked: Coliru is unable to fork again. :(
 
>

Celebrating 45 years of Software Engineering!

Dr. Baxter
woah, had no idea Ira Baxter was a Doctor.
 
Xeo
Doctor of Advertisement
 
@TonyTheLion lol, owl :)
 
1:32 PM
lowl, you mean? :P
 
0
A: deduce argument type from its iterator

R. Martinho Fernandes Considering the Haskell signature (a->b->b)->b->[a]->b that indicates the relationship between arguments, I'm wondering if there is one way to specify this kind of relationship in C++. Yes, there is. You are misguided in thinking that one does that with std::function, though. std::function i...

 
-1
A: deduce argument type from its iterator

NikYou can use typeid operator for checking the type of a pointer or object.

The best answer
Mark accepted
 
Xeo
oi, stupid onebox.
@R.MartinhoFernandes Btw, I think that B will be deduced in all cases.
 
Xeo
Just because it has a default argument specified doesn't mean it won't be deduced
 
1:38 PM
@TonyTheLion :\
 
@Xeo But const std::function<typename std::iterator_traits<It>::value_type(typename std::iterator_traits<It>::value_type, typename std::iterator_traits<It>::value_type)>& will not.
 
Xeo
I'm talking about your answer.
B foldr(F f, B z0, ...
 
Hmm, where do I talk about deduction?
Oh, I see.
Good point.
 
Xeo
Nowhere, and I know you just copied from Loki's code, but that B = ... is .. not so useful
 
Yeah, needs NotDeducible.
 
Xeo
1:41 PM
Or let it be deduced, and use ValueType<Iterator> as the second type
 
@Xeo Oh, I thought that was in the question.
Note to self: read question instead of deducing it from other answers.
ARGH, dunno how to fix it without adding too much unrelated crap.
 
@Xeo can you see if I messed up something?
(I know there's an is_convertible check missing, but I don't want to distract from the point and it will cause an error anyway)
 
Xeo
Looks good
Well, declval<T> vs declval<T&>
 
declval<Lounge> vs Lounge<declval>
 
1:51 PM
@Xeo Yeah, I thought of adding ampersands all over too.
 
Xeo
Btw, you could even use is_callable<F, auto(ValueType, B) -> B> :D
 
Really annoying to answer questions where there are so many things to fix in the original.
 
Xeo
To more closely resemble the Haskell signature
@R.MartinhoFernandes Guess why I didn't bother, hehe
 
std::result_of<auto(ValueType, B) -> F>
Lovely.
 
Xeo
lol
Btw, I wonder if it would be a breaking change to make std::accumulate call v = op(std::move(v), *first) instead of copying v.
 
1:54 PM
Fuck it. Adding all the ampersands.
 
Xeo
heh
 
Well, not all.
Still taking things by value as in the OP, but at least now the checks match the usage.
Don't want to also add std::forward :P
 
Xeo
mh
Just give his code a complete make-over :D
 
@Xeo Fixed! And fixed the bug which caused it. (I hope)
 
2:08 PM
Drat and double-drat. My TmobileCollisionShape class fires an 'OnMove' event but has no virtual 'move' method I can override in a TSnake decendant to move the tail with the head. I don't know whether to add such a method or to just use composition to make the snake:( Why do 'quick, hobby' projects have to be so awkward?
 
Hmm.. nothing is going to descend from TSnake, so I guess composition it is.
 
@Cat Ugh, TeamCity build artifacts thingy isn't great.
It flattens everything :<
 
Flattens what?
 
Oh wait, nevermind.
I messed up the pattern.
Woot now.
Is there a build variable to get the os/arch name from?
 
2:16 PM
teamcity.agent.jvm.os.arch, teamcity.agent.jvm.os.name, teamcity.agent.jvm.os.version
 
1 message moved to bin
@CatPlusPlus Yeah, found it, thanks.
 
Your friend said you were nice, I don't think you are nice @ all :'( ... what happened? Did cute kitty killed your inner niceness within?
 
@Cat Also, HOLY FUCK THAT THING IS FAST
 
Fuck LDAP, I'm gonna write auth plugins for shit
 
2:20 PM
Build + tests, 3 goddamn seconds.
 
Cleaning might not be enabled
First build took about a minute
[15:19:54][Step 2/3] ninja: no work to do.
 
I found Cat
 
Ah. Got it.
 
It should still be reasonably fast
The CPU is i7-4770
And there's 32GB RAM :v
 
2:24 PM
[15:21:43]Updating sources: agent side checkout (11s)
[15:21:55]Step 1/3: Generate Ninja descriptor (Command Line)
[15:21:55]Step 2/3: Build (Command Line) (5s)
[15:22:00]Step 3/3: Test (Command Line) (57s)
 
Yeah, I forced a clean.
 
neat
 
Yay, everything's proper now.
 
Xeo
@R.MartinhoFernandes lol
 
So, not only is the title misleading, but you also accepted, over 2 years later, an answer that is incompatible with either the title or the question wording. Would you please consider fixing your question? — sehe 14 secs ago
^ da fuck.
 
Xeo
2:36 PM
Why u no std::forward<decltype(r)>(r)? :P
 
Xeo
return f(std::forward<decltype(r)>(r), foldr(f, std::forward<B>(z0), ++first, end));
that looks so fucked up
 
There is login but no rego page?
 
Yes it's very difficult process
 
2:43 PM
> internal mail?
 
...
 
yes, lets all have a @loungecpp email
 
Ah, not so different from my machine, then.
 
I'd love to have deadmg@loungecpp.net
 
would be cool
 
JBL
2:46 PM
Who's the target of loungecpp.net ? Basically all people hangin' around ? Or just the regulars ?
 
welp
it's time for me to work on Unicode, strings, and the like, I guess.
 
oh have fun
 
JBL
> error: strings + Unicode and fun don't match
 
user3010322
@CatPlusPlus No emoticons. D:<
 
user3010322
2:48 PM
@DeadMG I can give you my Unicode impl for VS 2012.
 
user3010322
For the UCD anyways.
 
@JBL Hopefully we'll have enough open-source-y shit to get an open-source license for TeamCity.
 
user3010322
It'll allow you to query identifiers for Unicode.
 
user3010322
@R.MartinhoFernandes Pile in all our games!
 
user3010322
Oh wait, I'd have to open source my engine.
 
user3010322
2:49 PM
.... :c
 
I'm not actually sure what features I want from a Unicode implementation.
 
@JBL Cat is admining everything, but I think anyone we can recognise would be allowed in.
 
JBL
@R.MartinhoFernandes Was thinking of the users, not the devs :D
 
but what I definitely need is the ability to detect the input file's encoding.
 
2:49 PM
@DeadMG Unicode perhaps?
 
JBL
Oh, okay.
 
@JBL The devs are the users!
 
user3010322
@DeadMG ID_START, XID_START, etc.
 
$ ninja -t clean > /dev/null
$ \time -f "%E" ninja >/dev/null
0:05.11
$ \time -f "%E" ninja test >/dev/null
0:58.86
$
 
user3010322
Those are the markers for unicode ids, IIRC.
 
JBL
2:49 PM
@R.MartinhoFernandes Well, I won't work on it, but I'd gladly use it
 
user3010322
for a language, anyhow
 
Ok, so it's not that crazy fast after all. Just normal.
 
JBL
(If that's not considered rude)
 
user3010322
After that, you're really only going to need encoding and (maybe) decoding?
 
@JBL Oh, only Cat is admining. (Though I'll glady help if I can.)
 
user3010322
2:50 PM
You wouldn't want to normalize string literals because people should be able to specify non-normalized string literals.
 
If you have a project that you want to get built on TeamCity, let him know. It's sorta lonely up there atm :)
 
user3010322
You can, however, check if the string is normalized and in the Wide Implementation mark it as "normalized" for all intents and purposes later on.
 
JBL
@R.MartinhoFernandes So he'll get to be a tyrant in his own kingdom.
 
I don't know how to use TeamCity :s
 
user3010322
@R.MartinhoFernandes Does TeamCity require your repo / code to be open-source?
 
2:51 PM
@JBL He's paying for the shit.
3 mins ago, by R. Martinho Fernandes
@JBL Hopefully we'll have enough open-source-y shit to get an open-source license for TeamCity.
 
JBL
@R.MartinhoFernandes :)
 
@ThePhD No, but it wouldn't help.
 
JBL
Oh TeamCity is from JetBrains
 
@ThePhD I do, sorry
 
JBL
Didn't know.
 
user3010322
2:52 PM
@CatPlusPlus q___q
 
user3010322
Cat-san, purrreeease make an exception for mee? <3
 
Might figure something out for private projects later
 
@ThePhD What I need is to detect the encoding of the input.
 
user3010322
Purretty Purretty Purrreeease? <333
 
Though maintaining two build servers is meh idea
 
2:53 PM
Windows has a function for it, apparently.
 
if TeamCity isn't annoying to use I'm up for it
 
user3010322
@DeadMG String literals should be explicitly encoded?
 
It isn't, ask Robot!
 
user3010322
As in, marked with what a person wants?
 
user3010322
@CatPlusPlus :c Well I guess we can put LoungeChat up there and stuff...
 
2:53 PM
@ThePhD It should be if you don't want normalization.
 
user3010322
... It's been a while since I've opened up LoungeChat. I'm still very confused at how databases are supposed to work. >___<
 
@R.MartinhoFernandes is Team City annoying?
 
user3010322
@DeadMG Just make an implementation default. "Everything without a qualifier is utf8, non-normalized. If you want something else, use literal of form u32"" or ...", something like that.
 
@ThePhD Fuck no.
 
user3010322
:c
 
2:55 PM
besides, you're in the wrong place- I'm looking for detecting the charset of the input file.
once I have that, then I'll worry about handling everything else.
 
user3010322
Oh.
 
@Rapptz How so? (I like it)
 
@ThePhD I only said it twice before :D
 
user3010322
That's usually known before-hand, using either BoMs or just from the operating system.
 
@R.MartinhoFernandes I've never used it. Is it hard to set up, etc?
 
2:56 PM
@DeadMG Assume UTF-8, allow to put an explicit comment at start, like Python.
 
You only need to create the build config
 
user3010322
Use Boms or assume ANSI... that's really the best way to do it, unless the user gives you more explicit information. You can also have a compiler flag for each source file?
 
Or maybe assume default system shit.
 
Assume UTF-8
 
@R.MartinhoFernandes That's gonna go well with my VS extension that has a bunch of UTF-16 files.
 
2:56 PM
Whatever Windows things.
 
Xeo
Oh-oh, robot's gonna strangle somebody
 
user3010322
^ Default system shit is what python does a lot of the time.
 
@DeadMG EW what?
 
er, buffers.
 
@ThePhD No, 3 defaults to UTF-8
There's no reason to not default to UTF-8
 
2:57 PM
fact is, as near as I can tell, the encoding detection functions used by browsers/notepad++/VS/etc work just fine in 99.9% of all cases.
 
@ThePhD For anything Unicode, Python2 doesn't count. It's shit.
 
As for detection: either BOM is present, or user has to explicitly set the encoding
 
so I see no reason not to make a best guess.
 
That's the only sane approach
 
user3010322
Ooh. It must have been 2.7 that checked ANSI encodings.
 
2:58 PM
You can't distinguish between 8-bit encodings
 
user3010322
VS checks ANSI encodings. In fact, it defaults to them for most source files.
 
Best guesses are really not that good.
 
Magical detection is going to be unreliable at best
Also who the fuck cares about 8-bit encodings
Just require Unicode
UTF-8 by default, the rest via BOM detection
 
Has BOM? Interpret BOM. Has explicit comment? Use that. Nothing else? UTF-8.
 
user3010322
What's an explicit comment?
 
2:59 PM
See PEP above.
 
coding=XXX
 

« first day (1136 days earlier)      last day (3821 days later) »