« first day (1480 days earlier)      last day (3472 days later) » 

11:00 AM
@Rapptz the original proposal in that article seems a lot saner and more useful to me - it's very similar to what I had in mind
 
woah
 
great
now I need a std::move_if_noexcept_iterator
 
I just had a nightmare with alien owls, panthers and weird faces in the night; then I had a lucid dream in which I just woke up from that dream and analyzed the place in which the nightmare took place.
 
@JerryCoffin Not sure, but I think it all depends on the kids. The kid that I'm hosting for a week is the reincarnation of Satan.
 
user1804599
11:09 AM
@VáclavZeman could just as well use Scala.
 
@Rapptz how many LOC would you estimate a standards-conforming standalone <vector> implementation to be?
 
user1804599
haha setters fail
 
2k or so
 
I guess I have 1600 to go then
 
there's a massive amount of boilerplate with standard containers
 
11:10 AM
ye
I still need to very carefully triplecheck everything
 
I was working on a static_vector thing but there was so much boilerplate
 
and implement
assign and overloads, reserve, emplace/push_front/push_back, insert, erase
 
libstdc++ is 1.5k loc
 
@Rapptz if you want you can join me on this one, 4 eyes see more than 2. then you can rip out the cdeque parts and reuse the boilerplate for your own thing
not standalone though?
also I'm absolutely clueless why standard libraries choose their code to be unreadable
that entire "uglification" thing is just terrible
 
because they're free to use reserved identifiers so they don't clash with user code
it just so happens libstdc++ uses the ugly way (i.e. __stuff) and it's GNU style
 
11:15 AM
except private members/functions don't clash with user code
or local variable names
 
evil library user can do a lot of things
 
@orlp You are forgetting one thing.
The bane of C++.
Macros.
 
@Griwes macros are many things, but not the bane of C++
now that everyone uses them sparingly and with care I haven't been bitten by any macro in C++ for years
 
Again: you can't use non-reserved names in C++ stdlib implementation, because you can't know what macros the user defined before including your header.
 
hmm
I hadn't thought of that one
guess modules will solve that
 
11:22 AM
this is also why parameters use prefixes too
 
yeah it makes sense now
we really need to move away from this direct copy/paste #include system though
we need modules
 
I think STL said that he writes the stdlib by assuming everyone is an evil library user
 
user1804599
Waveforms 101 right here, and a beautiful summation at that. — Qix 9 hours ago
 
user1804599
dat pun
 
@Rapptz if you're interested, this is what I have so far: gist.github.com/orlp/9779ec3a7dbf738e2756
here be dragons and bugs though
 
11:31 AM
you can't specialise std::swap
that is UB
 
user1804599
Use ADL noob.
 
yeah that
 
I'm retarded
 
user1804599
You sure are.
 
but yeah lots of boilerplate
just the thought of doing it is irritating
 
11:34 AM
I can live with the boilerplate
it's the amount of research that's annoying
digging into all different sections of the standard
 
user1804599
 
"can this throw? is this allowed? is there a function for this?"
 
@rightføld If your company allows that. :)
 
user1804599
Same for Lombok.
 
@rightføld It is much easier to a dependency like allowed than to move to a completely different language.
 
11:38 AM
@Rapptz what's this static_vector you were thinking about btw?
 
cpx
Where is the C++ FAQ book? I found it on amazon but this one is from 1998.
 
it's like a vector except with a static compile-time capacity
 
cpx
They have one online too but its copy isn't available for download anymore it seems.
 
if you want I could make that once cdeque is done
 
nah it's fine
well it's up to you
 
11:40 AM
I think I want it myself anyway :P
 
I have 3 containers I want to write
I'll get to them later.
 
would be nice if you did some code review once it's done though
like you can stare at this kind of code for days
and still not realize what someone else notices instantly
 
cpx
Oh maybe here
 
@Rapptz I had an interesting idea by the way
@Rapptz delete namespace
 
eh?
 
11:42 AM
@Rapptz so you can use a namespace like detail and then delete it without every having to worry you collide with someone else
 
I use subnamespacing so this isn't an issue for me.
 
in general it's a pretty nifty feature though
 
like gears::io::detail::negate would be different than gears::functional::detail::negate
oh yeah I have it under low priority lol
 
mainly for hiding helper functions/implementation you don't want to pollute anything with
 
not really seeing a use
FWIW
when modules will come out
you will have the chance to export what you want
 
11:46 AM
that's true
which reminds me
like every other half hour
we fucking need modules =/
 
2020
 
r u kidding me
not even 17?
 
lol there's no time frame on it
but I sincerely doubt it'll make it by 2017
 
I'll be fucking 26 by the time we get modules
C++ is doomed
 
I wouldn't hold my breath in any case.
 
Ell
11:47 AM
When will compile times be decreased?
 
@Ell when modules come around
 
2050
 
lol
 
@orlp After I'm dead. Probably after you're dead.
 
user1804599
oh nice
 
11:49 AM
if modules happen to be in C++17 I will eat my shirt
 
user1804599
Lua has goto
 
yeah but no continue
 
user1804599
I don't neat continue.
 
they actually recommend you use goto instead of continue
 
user1804599
goto is great when generating code.
 
11:49 AM
goto is irreplacable in a systems programming language
Lua is not a systems programming language.
I used to like Lua, but that was in my early and dark days of programming =/
now that I think back to it the language is pretty bad
 
Ell
I hate lua :L
 
lua is pretty cool
 
Ell
Its far too barebones for me
 
its merits are not within the language itself - it's embeddability and speed
 
the only gripe I have with it is the lack of continue
the rest is pretty neato
 
user1804599
11:51 AM
Last time I needed continue was over a year ago.
 
I use continue daily
it stops excessive nesting
 
Ell
I'd use Python if I wanted an embedded scripting thing
 
Don't use Python embedded =/
 
the python API is a pain
 
You generally extend python
 
11:52 AM
and this is coming from someone who hates the lua API
 
not embed it
 
Ell
I haven't seen the api
@orlp extend it?
 
@Ell FFI
 
Ell
You have to embed an interpreter still
 
no, you run the interpreter
 
Ell
11:53 AM
Or jit or whatever
 
the idea with extending python is that you write the main part of your program in Python
and then offload the computationally intensive parts to foreign languages
 
Ell
@orlp surely that means you have to write some IPC bidness
 
@Ell No?
 
user1804599
lolwat
 
user1804599
11:54 AM
filebuf ctor doesn't open file lol
 
Fuck I forgot I was cooking pasta
 
@Ell you can call C/C++ functions from Python
 
Ell
Yeah that message sent late
 
@Ell using shared libraries
@Rapptz I generally prefer ctypes tbh
 
Ell
I was assuming the majority of the programme is written in c++
 
11:55 AM
@Rapptz I'd only consider writing an actual module if the speed per call is crucial
 
Ell
I'm on mobile internet, messages send slow :P
 
@Rapptz (call overhead)
@Rapptz I actually considered writing a JIT for ctypes, turning them into native calls
 
Lua has LuaJIT which is pretty fast
 
Ell
If the majority of your programme is written in c++ and you're also running an interpreter
 
not to mention Lua is both extendible easily and faster than Python in all accounts
 
11:57 AM
@Ell that's not extending
 
Ell
And the c++ side wants to call Python, there must be IPC of some sorts, right?
 
@Rapptz Python is the far superior language IMO though
@Rapptz not the implementation, speed, embeddability, FFI, etc, just the language itself
 
Ell
@orlp I sent my message before you said extend
It just arrived late :P
 
user1804599
Isn't there a proper C++ library for reading files that keeps different things (buffering, encoding/decoding, reading/writing) separated?
 
Ell
Now I'm just explaining why I said you'd need IPC
 
11:58 AM
@Ell you CAN embed Python, it's just a pain
 
honestly
there aren't many bad features in Lua that I can think of atm
I'm sure they'll pop up eventually
 
well let's start with weak typing and no integer types
 
lua does have an integer type
 
then that must be a recent addition
 
Ell
Does it?
 
11:59 AM
the C API does
maybe the language doesn't
 
I'm talking about the language itself
I'm sure the embeddability and speed of Lua is great
it's just the language itself I don't like
the entire vtables, tables, tables being arrays thing just doesn't feel right to me
I really like strong typing
 
yeah iunno
 
Ell
I want to try squirrel at some point
 
> = type(1.0)
number
> = print(9223372036854775807)
9.2233720368548e+018
> = print(2147483647)
2147483647
> = print(2147483648)
2147483648
 
Ell
@orlp yeah I don't like the whole table thing either particularly
 
12:01 PM
tables are great
 
Ell
It leaves the type system up to the user
Some call it a feature, I'd call it a bug :O
 
user1804599
uh
 
user1804599
does streambuf do anything with locales?
 
no
 
user1804599
I just want it to give me the bytes from the file and don't touch them in any way.
 
user1804599
12:02 PM
@Rapptz Then what is imbue for?
 
oh nvm
 
Ell
For when you want to make a tiara or talisman
Or runes
 
I always thought streambuf was just raw bytes reading/writing
damn my back is killing me
I'm officially a grandpa
 
anyway
bedtime
 
Ell
My wrists are kling me
Has anyone here played cubed rally redline?
Its a great android game
 
Xeo
12:14 PM
11
Q: Count from 1 to 1000 without using loops

Arun Prasanthi see the question on a c++ programming context, i check for a solution and one of my friend give me this code its works perfect but i can't understand it's logic and also how it's works. i asked to him about it but he also don't know how the program is actually works, i think he is also take thi...

burn eeeet
 
user1804599
burn E.T.
 
user1804599
I'm so used to <cstd…> that I included <cstdexcept>.
 
user1804599
> error: 'bytes' declared as array of 'auto'
 
user1804599
C++ is top kek
 
Ell
How do I defrost a frezer
Freezer
 
12:27 PM
You turn it off and wait.
 
Ell
How do I do it in an hour? :P
 
user1804599
Decoding binary file formats is fun.
 
lol until it goes wrong
 
@Ell With a fan-heater, (care - mains power and water!).
 
user1804599
If it goes wrong I just throw an exception.
 
user1804599
12:39 PM
Yay.
 
user1804599
My program can compile the bytecode for version 0.0; module main; let main! = { let x = 1; let y = 2; x } to Lua!
 
> This question already has an answer here: Printing 1 to 1000 without loop or conditionals 106 answers
lol
@Ell unplug, done
 
@sehe 9 votes for obfuscated crap. Wonderful.
 
how do I do noexcept(noexcept(swap(a, b)) with using std::swap?
 
is it a common homework question or what?
21.6k view
 
Xeo
12:46 PM
namespace tricks{ using std::swap }
...
noexcept(noexcept(tricks::swap(a, b)))
or something like that
no wait, that's not entirely correct
 
cpx
Why would you ever write it without a loop?
 
Xeo
29
Q: How do I write an ADL-enabled trailing return type, or noexcept specification?

R. Martinho FernandesImagine I'm writing some container template or something. And the time comes to specialize std::swap for it. As a good citizen, I'll enable ADL by doing something like this: template <typename T> void swap(my_template<T>& x, my_template<T>& y) { using std::swap; swap(x.something_that_is_...

@rightføld wat
 
user1804599
hmm
 
user1804599
I answered a duplicate of that.
 
@BartekBanachewicz Yeah, thanks for the reply. I checked there and also saw your post but all the hints didn't help much.
 
user1804599
12:57 PM
auto register = readUInt(); is a syntax error. ;_;
 
register is a keyword, no?
 
user1804599
Yes. :'(
 
@thecoshman It's funny.
 
Morning
 
@AndyProwl I see you couldn't resist refuting that asylum thread
 
1:05 PM
@JerryCoffin Have you told her that? :P
 
@sehe Yeah. Which is probably counterproductive because that thread should rather die in silence
 
I'm trying to do procedural terrain generation.
Harder than I thought it would be.
 
@BartekBanachewicz defer delete ptr; <3
 
user1804599
Is that Go++?
 
No, it's that language that gamdevlper created
I really like the new terminal icon.
 
1:19 PM
@Jefffrey That's terrible :|
 
I know, I was kidding. :)
I really like withX functions in Haskell.
Like withWindow $ \window -> do stuff
 
Ell
@Jefffrey John Blow?
 
They are the RAII of Haskell
 
user1804599
@Jefffrey olol
 
@Ell It's "Jon".
 
1:21 PM
@Ell Yeah, something like that.
 
user1804599
@Jefffrey Like withWindow return >>= \window -> do stuff? :D
 
why
no
withWindow doesn't return IO Window
It returns IO ()
 
user1804599
Hmm.
 
user1804599
Why can I not return a value? :(
 
Ell
@R.MartinhoFernandes oh yeah
 
1:23 PM
@Jefffrey What?
 
user1804599
I have to work around it with IORef. :(
 
It should return the same as the function.
 
@rightføld You can, just not the window.
guys
 
user1804599
Only ().
 
user1804599
I don't want to return ().
 
1:23 PM
withWindow :: (Window -> IO a) -> IO a
 
Yeah something like that
 
Then you can return the window with return as rightfold did.
 
You can't return the window because at the end of your action is removed
 
user1804599
I certainly can.
 
user1804599
withWindow return compiles just fine.
 
1:24 PM
Yup, but that's resource leaking
 
@rightføld You're left with a dead window, though.
 
user1804599
Yes.
 
user1804599
You can do something like runST does if you are willing to change your types and make everything harder for everyone with little benefit. :D
 
Can you "RAII" with monads?
Something like that when you return from a monad block, then the resources of the monad are cleaned.
 
user1804599
1:26 PM
Your code fails btw.
 
user1804599
Use bracket.
 
user1804599
If the action throws an exception the window isn't destroyed.
 
@rightføld Compiles and runs perfectly fine on my machine
Oh yeah
Woops
I still don't understand why GLFW.getTime returns a Maybe Double
It looks so dumb.
It's implemented as something like if time == 0 then Nothing else Just time
why
 
I had to get another haircut
the haircut I got yesterday was a disaster but I only noticed it after drying my hair
 
Hey everybody
 
1:41 PM
Hey
 
user1804599
Hello.
 
Ell
@Jefffrey that's terrible
 
Have you met anything like that?
I've installed libgmp3-dev and added -lgmp flag to makefile
but omg omg same errors. lol.
 
ask on SO
 
1:43 PM
sure, as far as i won't get pwned for stupid questions ;p
 
This is fast-track SO. /s
 
being pwned there is more pleasant than being pwned here
 
user1804599
You are more likely to get pwned here than on Stack Overflow.
 
I know from first hand experience.
 
also don't ask stupid questions
 
1:44 PM
Alright, alright.
Though people add me rep means my questions aren't really stupid
 
user1804599
If you are left-wing then stupid questions don't exist.
 
My questions are stupid.
 
@Ell Yeah. Maybe I'm getting it wrong though.
 
@AlexM. You want to see a stupid question? You need to look at my question log. I got downvoted 7 times for what I think might be the stupidest question in SO. I think I was sleep deprived when I asked the question "Why is this printing 0?"
 
user1804599
Swapping out foldl for scanl is nice for debugging.
 
1:48 PM
If I hadn't asked that question, I would have downvote priveleges.
 
can i vote for msgs in chat? xD
 
Star me!
I only have 1 hehe
Anyways you are most likely using cmake on the wrong directory. Try doing it on the root of the folder.
Apparently EVGA is going to release a 1.5GHz version of the GTX980
 
<\3
 
user1804599
> (\window -> action window)
 
@rightføld what does your name mean?
 
user1804599
In functional programming, fold – also known variously as reduce, accumulate, aggregate, compress, or inject – refers to a family of higher-order functions that analyze a recursive data structure and recombine through use of a given combining operation the results of recursively processing its constituent parts, building up a return value. Typically, a fold is presented with a combining function, a top node of a data structure, and possibly some default values to be used under certain conditions. The fold then proceeds to combine elements of the data structure's hierarchy, using the function in...
 
Xeo
@rightføld (do initGLFW; initWindow)!
also, deinitWindow >=> const deinitGLFW
 

« first day (1480 days earlier)      last day (3472 days later) »