« first day (1601 days earlier)      last day (3362 days later) » 

user3010322
3:00 AM
Ranges in the standard force people to not implement range-for internally with a for loop that initializes both expressions in its start.
 
user3010322
{

    auto && __range = range_expression ;
    for (auto __begin = begin_expr,

                __end = end_expr;

            __begin != __end; ++__begin) {

        range_declaration = *__begin;
        loop_statement

    }

}
 
user3010322
THAT wouldn't compile in the language, so THAT would have to be changed.
 
copy/pasting the definition of ranged-for isn't going to solve your problem
 
user3010322
It's going to help me vent and feel better.
 
making nonsense probably won't
why would an expositionary definition compile as-is? it has macro-like placeholders in it
NEW AGE OF ULTRON TRAILER
 
3:04 AM
I always wondered
what is "lightness"?
 
a noun
 
but to say that the "lightness" races makes no sense
 
@orlp Whereas "orlp" is perfectly grammatical.
 
@LightnessRacesinOrbit Orson Raphael Lennard Peters
 
well that changes everything
 
3:07 AM
@orlp It's grammatically correct
 
@orlp It's deliberately mangled into near-nonsense without losing grammatical correctness. It is designed to make you wonder with childlike amazement at the unending possibilities of imagination.
 
You sound so baked.
 
What is "lightness" and how does it "race in orbit"? Only you can decide for yourself. What does it mean to you?
@Rapptz p much born this way tbh
 
3:10 AM
Value of the color is determined by how light or dark it is. In colorimetry and color theory, lightness, also known as value or tone, is a representation of variation in the perception of a color or color space's brightness. Various color models have an explicit term for this property. The Munsell color model uses the term value, while the HSL color model and Lab color space use the term lightness. The HSV model uses the term value a little differently: a color with a low value is nearly black, but one with a high value is the pure, fully saturated color. In subtractive color (i.e. paints) value...
 
born too late to explore the earth
born too early to explore space
born just in time to bake
 
Thinness Ventures into a Volcano
 
born just in time to browse dank memes
 
Fascination Runs through Patterns
 
Width Stumbles around Itself
Performance Roots in Evil
there
I did it
 
3:14 AM
can't use rvalue refs
user would have to explicitly std::move.
hmrh
 
@Rapptz Either you botched up your description or yes, you are doing something very wrong.
 
well give me a solution eh?
:)
 
Don’t use mutable.
 
time to const_cast away!
 
Doesn’t sound sound.
 
3:17 AM
the other alternative I have is to pass the object by value and then continuously copy the object whenever I want to modify this one variable.
 
My main beef is with the description. Can you un-botch it?
 
i have this annoying tendency nowadays
I get really tired after eating
like, almost falling asleep tired =/
 
nn
 
Good night.
 
3:21 AM
@LucDanton I have an object. Let's call it struct object that has some variables in there. A parameter object really. It's used to configure the parameters in many functions. One of the variables in the object can be modified by the functions because it's a sort of 'state' I suppose. The issue comes to play when I want to pass the object as a parameter. There are reasonable defaults so it needs to bind to a temporary.
So that I can do my_func(args) and it uses the default parameter object.
but the only way to reasonably bind the temporary is through const ref, r-value ref or value and neither seem really preferable.
I can't really move the variable outside I think
 
Modified as in by-ref, visible to the caller?
 
no the variable is an implementation detail
 
Then by-val.
 
it seems like a waste to keep copying though :(
owell
 
It can’t be by ref, any sort of ref. Because then the function has nothing they can mutate.
If you want an int, ask for an int. If you want some state, you need to have the state.
@Rapptz Asking for 'I want to modify it' and 'it musn’t be defined in the scope of the function' is having one’s cake and eating it, too.
makes sense?
What you could be expecting, ideally, is a language where you write by-val to mean that ('it’s my own thing, I can modify it as I want'), but the compiler has room to do optimizations. You only touch state.foo.bar.baz? Then you get that as a variable while the rest is transparently implemented as by-ref.
Instead of having the programmer play compiler when they have to choose between by-val or by-ref-to-const.
Of course our 'ideal' also raises lots and lots of questions re: modularity/separate compilation/what signatures look like across TUs :) No free lunch?
 
3:30 AM
I could go crazy and use a pointer!
the const doesn't propagate
 
Caller will have their context/state modified.
 
yes
in any case I kinda doubt copying 3 ints in a struct is gonna kill me
 
It’s awful. You’re worrying about pointless things.
 
I know
it's fun in a way
 
I really, really dislike C++ references :/
 
3:33 AM
I am indifferent.
 
3:45 AM
whats the technical term for 'private' 'public' and 'protected' access specifiers in classes?
 
'Access specifiers'.
from 11.1 Access specifiers [class.access.spec]
 
I don't get why overriding methods lets you change their access specifier
 
4:11 AM
alright I'm gonna name this option "ensure_ascii" too :v
 
you suck
 
do you have a better name
I'm not feeling creative
 
escape_unicode?
Might reverse the meaning (re: true/false), hopefully not a problem.
 
but wouldn't that imply escaping everything?
 
that’s true
 
4:16 AM
iunno ensure_ascii is pretty descriptive
I don't think I'm lying
 
My problem with is it is that it suggests that ASCII is relevant or somehow desirable
 
I suppose
escaping every character sounds awful
 
enum class escape_mode { non_ascii, /* TBD */ };
 
ensure_basic_latin
oh oh
escape_multi_byte?
 
Starts at 0x7F though, no?
 
4:22 AM
the escaping? yeah
 
If it came to that I wish I had a better escaping scheme to recommend.
'à' is not something 2spooky4display
 
well I don't know what unicode group to start escaping at
post-BMP?
 
I don’t think it’s as simple as ranges to escape :/
 
but isn't that.. like a lot? :(
 
What, ranges? Yeah, kinda
 
4:28 AM
well at the very least I got unicode working properly
a couple months ago I didn't handle the \uXXXX escapes of the surrogate pairs
I like escape_multi_byte.
 
Ya know, escaping everything would be hilarious, no?
 
lmao it'd be so awful
 
"Human readable"!
 
I'm not sure why I wrote this tbh since I never used it in Python.
Oh typing this sentence reminds me why I did it.
I wanted to learn how to turn utf8 to utf16.
 
'Is it in the spec?' would be my sole concern.
 
4:32 AM
what is?
escaping?
 
Mandatory escaping, that is.
 
Oh. No.
It's a convenience thing.
JSON files are required to be encoded in UTF-8.
 
Convenient to whom?
 
Again, I don't know.
I really did this as a learning exercise.
 
That goes in the YAGNI bin.
 
4:34 AM
while looking up help I found SO questions of people asking for it though.
 
@Rapptz By hand?
 
yes
 
how awful
 
ikr
On Windows I use MultiByteToWideChar.
@LucDanton github.com/…
 
I can’t even get through the multiple definitions re: bytes this, and sequence that.
@Rapptz I only consider GitHub-wide searches relevant for comedy purposes.
 
4:36 AM
aw it's not that bad
the people putting it as = False are weird though
it's false by default
that was an odd search
 
mmmh
Maybe even talking about 'escapes' is too close to the details and too far from intent
E.g. I like escapes for dev purpose
So enum class display { verbatim, debug }; is one step closer to the sort of naming scheme I prefer.
makes sense?
 
I suppose.
 
Could still use more and more rounds of bikeshedding though, because printing "\uABCD" when the source contains "\uABCD" is a verbatim display, so to speak.
 
I used char32_t today in place of uint32_t
 
exact, escaped back to escapes because I think I’ve spent too much energy on this
 
4:43 AM
feels pretty dirty looking back but I'm still chuckling
 
@Rapptz isn't char signedness implementation dependent?
 
There's always enum class escape { multi_byte, other_shit };
Not char16_t and char32_t.
 
Just for plain char. char32_t and char16_t aren’t character types anyway.
 
uint_least16_t and uint_least32_t respectively.
or whatever that typedef is
 
That’s the representations.
 
4:45 AM
yeah but it implies sign!
 
thats just confusing... i define my integer types explicitly
u32 is far nicer than char32_t
 
You can’t define integer types.
A big point of char32_t & co being that they are their own separate types. That a sane representation comes with it is nice too though.
 
it's implementation defined in C
 
That’s weird. You get the (un)signedness though right?
Yeah you do. That’s fine then.
 
oh the encoding is implementation defined
but C++ requires UTF-16/32.
 
4:50 AM
Haha you need to check against __STDC_UTF_32__ to get the guarantee that yes, char32_t is for UTF-32.
 
yeah
sounds terrible
 
How convenient!
@Rapptz "[char16_t] is the same type as uint_least16_t"
 
that's even worse
 
Eh, kind of not really.
Remember, no std::is_same.
 
and no overloading I guess
but
if it was in C++ it'd be awful
 
4:53 AM
Can you imagine if it were the same type for any sort of octet or honest UTF-8!
oh wait
 
Why can you not use using declarations at class scope... ugh
 
@Pris What do you mean?
 
On the semi-topic of strings, I've been writing string_traits and passing strings as const String& str where template<typename String> to avoid temporary std::string construction.
How insane is this on a scale of 1 to 10?
 
Are those two things connected?
 
4:55 AM
?
@Pris Oh that's ambiguous I imagine.
 
The string traits and pass-by-ref.
 
Yeah.
 
What’s the connection?
 
Instead of std::string::size I do string_traits<String>::size(str); etc.
 
doesn’t seem too great
 
4:57 AM
sorta
 
Are you abstracting over the character type?
 
yeah
 
Mmmmh that’s tough for string views.
 
I only started doing it because I had a lot of temporary std::string constructions going on.
not in my JSON thing, another thing.
 
Good question actually, does template<typename CharT> void foo(string_view<CharT> s); have any hope of working?
 
4:59 AM
I don't think so Maybe
 
Nope. I think only derived-to-base works here.
 
128
A: Inheriting constructors

SumaIn C++03 standard constructors cannot be inherited and you need to inherit them manually one by one by calling base implementation on your own. If your compiler supports C++11 standard, there is a constructor inheritance. For more see Wikipedia C++11 article. With the new standard you write: cla...

 
Well, fuck. That’s actually not great, is it?
@Rapptz Doesn’t name a constructor.
 
I know I'm just explaining why I think it might be ambiguous
 
How does it work the rest of the time then?
 
5:02 AM
Hmmm.
 
I think you have to use typedefs or using x=y
 
struct base { using microseconds = int; }; struct derived: base { private: using base::microseconds; };
Of course that’s not entirely similar.
 
oh that
 
ns::ns::klass::alias::member vs ns::ns::entity
 
that's similar to inheriting constructors though, it needs that base class :v
 
5:04 AM
But somehow you don’t have to disambiguate. If you remove a class type from the access specifier, does that add ambiguity?
 
I wish you could do 'using vec = std::vector;' instead of having to add the template stuff
 
I think naming a fully-qualified entity is the simplest of the two, really. If you consider all the indirections through aliases you can do.
What are the chances of getting struct basic_string: basic_string_view?
That’d be so hackish lol
 
@Pris lazy
Sometimes I wish I had some of Python's odd loop constructs
like while ... else or for ... else
 
One day I thought it would come in handy, then I realised I wanted it to do something else.
I.e. more like if … else.
 
hm?
You mean for ... else is essentially a for loop and if it doesn't run once then it goes to the else block right?
 
5:11 AM
Yes.
 
@LucDanton lol unicode
 
yeah that's what I want right now actually
:(
 
@ParkYoung-Bae ¿What?
 
so I guess python was the wrong comparison
 
¡I do what I want!
@Rapptz :D
It’s because in my head for is a repeated if. So if you bring in the else keyword, I already have expectations.
 
5:13 AM
yeah same
the python for .. else is essentially 'no break'
or maybe.. finally?
I don't know.
false expectations tbh
 
Don’t really care for break though :( They do crop up occasionally, but not really for exotic stuff to the point I want else.
@ParkYoung-Bae behold
 
omigod bepo levi
> certains symboles mathématiques courants ± − ÷ × ≠ ≃ ≮ ≯ ≤ ≥ ≰ ≱ ≲ ≳ ¼ ½ ¾ ‰ ;
welp
 
Is that ¬ true?
 
¬_¬
 
@LucDanton This actually came up because I did for(...) {} else { } in C++ for the same exact reasons.
"oh this if statement should be a for loop" but I never removed the else.
 
5:18 AM
and if(…) do { … } while(…) else … is just absurd looking
 
lol
 
I want strong types pls
 
I guess I'll use goto :v
 
Plus DRY :v imagine messing up the conditions
@Rapptz nice try 0/10
 
if is just syntactic sugar for goto!
 
5:19 AM
-1÷1000000
@ParkYoung-Bae it hαs α dεαδ kεγ φορ gρεεk as ωεll!
 
Parce qu'on emploie les caractères grecs couramment !
 
I’m riffing off the maths and science theme.
Oct 16 '14 at 12:38, by Luc Danton
@sehe ¿How do you write ‘Bacon–Erdős number’ with the correct symbols and typography then?
 
You don't
 
criminal
 
If it's not in the American alphabet then it's not worth typing
QED
 
5:25 AM
good one
4/10 because I’m not feeling generous
 
@ParkYoung-Bae hang on, how do you spell résumé in American?
 
same way but people drop the accents due to laziness
 
or naïvety?
 
same as above
 
5:29 AM
resume and naivety
 
@Rapptz I’m glad you are chiming in as an American speaker.
façade
 
facade
garcon
francais
 
maître d' <- kill me
coöperation
 
I don't speak American!
 
The Latin alphabet was invented for and by Americans, don't pollute it with silly European additions
 
5:30 AM
I speak English.
Don't let LRiO know though.
 
@ParkYoung-Bae 'coöperation' has been advocated by The New Yorker.
Also, not how we spell it.
 
@LucDanton What the fuck?
 
I’ve been spelling American English words all this time btw
@ParkYoung-Bae Ya know, not to be mistaken with a 'coop' /kuːp/.
Checkmate!
 
Makes perfect nonsense
 
Well, you can use co-operative if that’s more your thing.
No diacritics!
'na-ivety' would be a travesty though
 
5:36 AM
Why are you even awake
 
haha
 
6:14 AM
I regret writing my tests with json::value::to_string
considering I removed that feature 7 commits ago
 
7:01 AM
They call it any, because you can put anything into it. But they could also call it some, because you can fetch something (and not just anything) out of it.
 
@Rapptz Oh we can @LRIO
@Rapptz Americain*
@Rapptz lel
 
@sehe lol
Good morning sehe :)
 
Good morning. And: Thanks AmEx, Jens...
Spam has many colours these days
This looks nice. And I love the way the author of the book tried to "not spam" the mailing list with it:
>
Don't worry, I think books about Tarsnap fall under "discussion about
using Tarsnap".
 
7:19 AM
Hi there
@sehe Oh, you don't have the telecom company offering you a refund? :p
 
Not yet! Patience
@kellabyte really the Iraq war was a GIANT misunderstanding
Funny in context
strtok doesn't directly work with std::string, and there are better ways to tokenize a string. — Fred Larson 9 hours ago
I'm amazed this answer is still alive
 
7:35 AM
@Nooble I actually want different calls and caches.
 
7:58 AM
Goddamn, I just spend 2 hours tracking down what I thought was a GCC bug.
Turns it was some strict-aliasing violation that only manifest after several levels of inlining.
 

« first day (1601 days earlier)      last day (3362 days later) »