« first day (1722 days earlier)      last day (3216 days later) » 

12:00 AM
@hello $15 per microsecond.
 
@Nooble Nice. My problem shouldnt take you, 1/1000000000000 of a sec
 
bro this is your 10th time posting your questions here
stop
 
Its a different problem
 
@hello I suck at C++.
 
@Nooble OpenGL hates all of us, koalas and non-koalas alike
 
12:04 AM
all you do here is post your problems
 
@Rapptz My appologies
 
meh it's whatever
 
@Rapptz Any help?
 
@Prismatic Hey do you use glad?
 
no
 
12:06 AM
@Rapptz Good. So what do you want to talk about?
 
@Nooble yes
 
@Prismatic Yay! Glad master race.
 
Im not using the latest version though, I think the author was making some changes to it (I actually talked to him on #OpenGL recently about some cool stuff he implemented)
He added pre and post callbacks for every gl call... or he's going to
I can finally remove all my debug macros :D
 
Ooh I used to go on #OpenGL and pester them with all my problems.
@Prismatic I use a logging function for debugging. I can just turn on verbose mode and it'll start outputting everything.
6
Q: What is good practice for generating verbose output?

andreas-hwhat is good practice for generating verbose output? currently, i have a function bool verbose; int setVerbose(bool v) { errormsg = ""; verbose = v; if (verbose == v) return 0; else return -1; } and whenever i want to generate output, i do something like if (debug) ...

I've started to make a new rendering engine and I'm trying to make it as non-crappy as possible.
I'm wondering whether I should use an Init() function to initialize glfw and glad and such or if I should put that in the constructor of Context.
 
@hello to the anomaly
 
12:15 AM
@sehe Okay!
 
Ell
@Nooble constructor deffo
Two stage init is bad
 
@Ell But then Context would have to be a singleton, no? Because if an instance of Context destructs, it terminates glfw.
 
@Nooble I meant OpenGL error macros. Calling 'glGetError' after each call etc. Now you can just assign error callbacks with glad
 
@Prismatic Oh.
 
I just have a 'window' class that creates a context and manages its lifetime. What if you want more than one opengl context?
 
12:24 AM
@Prismatic Err so how do you do it? How do you handle terminating glfw and such?
 
I use SDL... but Im guessing context set up is similar. Just have a window object where you create / destroy your context raii style
 
@Prismatic Sadly glfw has glfwInit() and glfwTerminate(). Maybe I should switch to SDL. So do you call gladLoadGL() on construction of your Window class?
 
@Nooble imGladToLoadGL() ?
 
@Borgleader everyoneIsGladToLoadGL()
 
@Nooble Yeah, after I create the context. I don't know if you only need to call it once, or every time you create a new context... I haven't done multiple windows yet. Either way you can create a static variable for that case if you only need to init once
 
12:33 AM
@Borgleader Hehe.
@Prismatic Doesn't SDL have SDL_Quit() that you need to call for cleanup?
 
It has an SDL_Init as well
You can protect things you want to call once with static members
 
Right. So if you're calling SDL_Init at the constructor, you call SDL_Quit at the destructor right? The problem then is that if you have two contexts, and one destructs, SDL quits.
@Prismatic Well yes, I know.
 
You can have a window count. If the window you're creating is the first window, call SDL_Init in the constructor. If the window you're destroying is the last window, call SDL_Quit
 
Oh. Why haven't I thought of this :P
Thanks @Prismatic.
 
> libboost-dev is already the newest version.
libboost-dev set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
newest version my ass version.hpp says #define BOOST_LIB_VERSION "1_54"
 
12:42 AM
Or you could create a single application class to manage your windows (which would be a singleton... though I never really enforce singletons; if you're dumb enough to make multiple 'Application' classes without reading docs, reap the consequences), and just call Init and Quit in that classes's constructor and destructor
lots of options, all of them ugly. bless C and C++ :p
@Borgleader what distro
 
Ubuntu 14.04 LTS
 
@Borgleader Might need that new PPA if Ubuntu.
 
local/boost-libs 1.58.0-2
Free peer-reviewed portable C++ source libraries - runtime libraries
 
@Prismatic Praise Bjarne.
 
I wanna be like @sehe and be a boost pro
:D
I wont use vim though (or wtv his editor is :P)
 
12:45 AM
thats what you get for using debian
 
@Borgleader He's really good with it.
 
I'm too comfortable with VS & R#++ to switch
@Nooble Hmmm I'll look for that
 
@Borgleader vim
@Borgleader Oh me too. I like R# a lot
But not for C++
Too slow yet
 
Its not as good as VA for the time being, but I'm giving them a chance because VA pissed me off when I bought a license (they kept telling me "hey new version available" and if i updated well it was too recent for the license i had so it would shut itself down)
also the license is supposed to cover a year of updates, im fairly certain i got at most 6 months
so I'm going with Jetbrains this time.
 
I never liked VA.
VA has all the actions, it seems but so awkwardly organized... It's almost like vim
 
12:54 AM
I use VA at work, its fine but I'm not the most advanced user
damnit this ppa seemed promising but didnt have 1.58 =/
 
you could just build boost yourself
 
Getting 1.58 takes all of ~4-5 minutes including compilation
 
and then add it to your path
 
I wish our standard library had networking :S
 
just compile it yourself bub
 
12:56 AM
@Nooble methworking?
 
@Borgleader handy starter: sudo apt-get build-dep boost-all-dev to install all prerequisites
 
@Borgleader Heh.
 
> borgleader@Ayden:~$ sudo apt-get build-dep boost-all-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to find a source package for boost-all-dev
im probably missing yet another ppa
 
boost-dev-all? Srsly just search the package (or auto-complete)
sudo apt-get build-dep libboost-all-dev
 
just get a better linux distro
 
12:59 AM
@Prismatic no, im a linux retard and ubuntu is the "friendliest" ive found so far
> Picking 'boost-defaults' as source package instead of 'libboost-all-dev'
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
i guess im good
 
@Borgleader is that build-dep? Sounds a little like it's something else. Or drop -dev. Oh well. I should have known better than to serve these from (distant) memory
 
Ell
@Nooble oh you mean init ing the library?
I think you just have to call that manually in main
I think that is the best way
Or make a global static object which inits and deinits it
But a gl context shouldn't be associated with an instance of the SDL library
 
Well if I were to make a rendering library myself I mean. I'd have a Context class.
 
Hey maybe I should stream my boost building adventures :P
j/k
 
I got excited for a second.
 
1:06 AM
who the hell would watch someone else run bjam =/
 
Me.
 
Maybe some day I'll stream me working on my compiler, so you can laugh at all the stupid bugs in my code :(
 
Imagine me streaming. It's gonna be a session of Lounge<Code Review>.
 
I just have to get rid of the really stupid ones first :P
if i do ./b2 install it will replace the current boost version i have?
 
depends on the prefix. Possibly, yes
 
1:15 AM
hmm... ok i'll have to figure out what the right prefix is
 
./b2 --prefix=/usr/local eg
Or just, don't install.
Is what I do
 
But I like it when it finds everything automagically
 
do any projects outside of boost use boost's build tools
 
0
A: How to compile boost async_client.cpp

seheE.g. clang++ -std=c++03 -Wall -pedantic -g -O2 async_client.cpp -o async_client -lboost_system -lboost_thread -lpthread Assuming your system's packaged version of Boost (or pre-configured include & lib paths). To make use of your custom built Boost library tree in ~/custom/boost: clang++ -std...

@Borgleader Ok, then don't use a prefix, or use /usr and --layout=system (that's default on Unix anyways)
@Prismatic I believe I once saw one. It's a rarity
I'm going to leave. Night all
 
@sehe nn
I'm an idiot and forgot to sudo pm-powersave false before launching the compilation
it'll probably take a few hours
meanwhile my laptop is locked up so im back on my desktop
 
1:29 AM
@Prismatic I’ve also seen one or two use it. Don’t remember the names off the top of my head though.
 
Ell
Boy exes can be a handful
 
@Ell ?
 
Ell
My one is particularly difficult to understand
 
How about your two?
 
Ell
Very punny
 
1:43 AM
ty :)
Huh, streaming takes less bandwidth than I thought, this 1 min video i took is <6MB o.o
good to know i guess
lets encode it to webm and see how big it is then
bigger than 6MB...whattafail
(disclaimer: the fail is probably mine, encoding settings 'n all)
 
I don't remember why I changed a function parameter from unique_ptr<T> to T* ... the function still takes ownership of the pointer's contents :/
 
2:02 AM
 
That feet reminds me of ... hobbit
 
y iz dis room ded?
 
always dead on weekends
 
@Borgleader Dunno, it's late I guess.
 
2:19 AM
@Nooble @buttifulbuttefly usually shows up right about now, along with @MarkGarcia
 
@Borgleader Cicada is at an airport/on an airplane right now, I think. Don't know about Mark.
 
@Nooble :O
 
2:34 AM
oh shit I just came across a crazy compiler bug in clang
or maybe its not a bug and its undefined behavior or something but gcc gets it right
 
@Borgleader Last I heard from Cicada was on Mumble anyway, he was having trouble with airport WiFi.
 
@Prismatic ?
 
2:53 AM
If you compile and run that in gcc, it works as expected
But in clang I get a seg fault! (on coliru anyway... on my computer, clang manages to run the application, but the output I get is wrong, it creates 5 different types instead of 3)
I don't think I'm doing anything too far out of the ordinary, but I might be doing something that isn't well defined? OR MAYBE IVE FOUND MY FIRST COMPILER BUG, SO EXCITING
Should I post on SO?
 
Ell
Probs not
 
Either way I kinda need a work around for clang :/
 
@Prismatic Works in MSVC
 
awwwwww snap
 
Once i got rid of the using stmt, and include cstdint (because you forgot to)
and its std::uint32_t btw ;)
 
3:00 AM
will keep in mind :P
 
code looks a bit fucky
 
What part looks fucky?
 
44-45
 
> Registered Component 0: int
Registered Component 1: double
Registered Component 2: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >
0, 1, 1, 2, 0
 
@Rapptz You think there's a static init order problem?
 
3:02 AM
yea
don't even know why you overcomplicated your mechanism.
 
how is it overcomplicated?
 
nvm
 
Burma is a really beautiful place holy crap
 
aren't static members zero initialized anyway? so... in that case init order shouldnt be an issue
 
3:21 AM
Yall should watch that Top Gear special episode
 
Ell
I shouldn't be awake
 
@Ell Welcome to the club.
@Borgleader I still haven't watched the last episode.
S22E08 I think.
 
@Nooble Burma is Series 21 Ep7 Part 1-2
I havent watched season 22, its on netflix
 
@Rapptz What game is this?
 
3:32 AM
Splatoon
 
3:51 AM
@SavedYouAClick
Don't click on that. I already did. Shorty Award winner. (Tweets by @jakebeckman)
2.7k tweets, 195k followers, following 307 users
TIL about ^
 
You know what
I like doing the live stream stuff
I'll be going on in about 15/20 minutes
 
@Rapptz Hiding the static in a function seems to placate clang.
If it is an init problem, then that way the counter is init only when required I guess so its in the right order?
 
4:42 AM
CLANG IS STRAIGHT UP VILLAINOUS coliru.stacked-crooked.com/a/b9667177a6fb994c
 
so over-engineered
 
wha? hey bud you cant just throw around words like overcomplicated and overengineered without justifying yourself
 
sec
I'll give you a shorter implementation
 
Its like 20 lines!
 
same issue on clang
weird
 
4:48 AM
are function local types a no-no with templates? I read they weren't supported pre c++11
 
well with this shorter implementation I'm convinced it's a clang bug
 
are you a member of their mailing lists? you wanna file it?
 
I wonder how uint compiles there considering I forgot it
that's a real wtf there
@Prismatic ask a question on SO
 
ok
 
4:54 AM
Also your implementation is slightly cleaner but get_counter() isn't protected
I know it doesn't really need to be but whatever
 
I'm not sure why Clang gives garbage
It shouldn't.
 
yo @Borgleader, can you compile the example Rapptz just linked in msvc and see if it works
(if its not too much trouble)
 
he'd have to change uint to uint32_t
Compiled with /EHsc /nologo /W4
main.cpp
Compilation successful!
Total compilation time: 125ms
0, 1, 1, 2, 0, 0
0, 1, 1, 2, 0, 0
0, 1, 1, 2, 0, 0
Total execution time: 937ms
 
> 0, 1, 1, 2, 0, 0
0, 1, 1, 2, 0, 0
0, 1, 1, 2, 0, 0
 
rise4fun is so slow
 
5:00 AM
clang getting btfo
 
i added typedef uint32_t uint; right before main, but that was all
 
5:16 AM
k I asked the question
2
Q: Unexpected result for a type counter using templates with function local types in Clang

PrismaticI wrote a class template based on two types that is assigned a unique index based on its template parameters: template<typename SK,typename T> struct Component { static uint const index; }; The expectation is that for each new type, index is incremented: Component<X,A>::index; // 0 Component

I couldn't think of a good title... and my question kinda takes awhile to get to the point
but whatever
I hope a clang dev replies and files it as a bug or whatever (if it is one) so I don't have to :p
 
oh I didn't mention
I was gonna say "Ask a question because it's bound to get you good rep"
 
5:54 AM
anyone here?
 
6:06 AM
@Prismatic Amusingly you can change Z to foo<Z> and it still does the same thing.
main.cpp:3:7: error: typedef redefinition with different types ('int' vs 'unsigned int')

using uint = int;

      ^

/usr/include/x86_64-linux-gnu/sys/types.h:153:22: note: previous definition is here

typedef unsigned int uint;
lovely
 
Morning!
 
@LucDanton oh POSIX
wtf
 
It’s actually under a macro though. I don’t know why it’s set.
 
6:35 AM
@Prismatic Looks like a bug to me:
0
A: Unexpected result for a type counter using templates with function local types in Clang

wilxThis looks like a bug to me. I am not aware of C++11 rules that should make a difference for function local types and global types. If you dump the assembler, you can notice that while for X and Y the values get actually computed, for Z they are precomputed. The guard variables for the counter s...

 
morning
 
Morning.
 
7:18 AM
I took this in the backyard a few days ago, I think it's really pretty :p
 
hey uh
Why can't lambdas modify vectors even if they're captured
 
7:33 AM
@VermillionAzure Test case?
Ah!
mutable keyword.
 
@wilx doesn't help
 
105
Q: Why does C++0x's lambda require "mutable" keyword for capture-by-value, by default?

kizzx2Short example: #include <iostream> int main() { int n; [&](){n = 10;}(); // OK [=]() mutable {n = 20;}(); // OK // [=](){n = 10;}(); // Error: a by-value capture cannot be modified in a non-mutable lambda std::cout << n << "\n"; // "10" } The ...

 
no, it doesn't help
 
Test case then.
 
enable side-effects
 
7:35 AM
@VermillionAzure Also, realise that captured variables are copied by default.
 
7:45 AM
that is the worst SSCCE ever
 
but yeah wilx solved it
the syntax is &var
 
@VermillionAzure I do not think you want to use lambdas this way.
 
not &, var, var, var.
 
@VermillionAzure Alternatively, with &path as well: coliru.stacked-crooked.com/a/dfba6d56bd4ebfaa
I think neither produces results that you want.
 
7:52 AM
ugh
all i wanted to do was to produce a simulator for a member function
@Rapptz aren't they equivalent?
the compiler said it was redundant
 
@VermillionAzure: Maybe you just need to make the path a function parameter instead?
It all depends on the desired semantics/result.
 
@wilx like i said
all i wanted to do was to simulate a member function
 
Xeo
mornin
 
fucking shit a std::bind works better than jumping through hoops like that
 
@VermillionAzure Well, then your code would be broken the same way if path was a member. :)
 
7:55 AM
@wilx well thanks
that is a big problem
all i want to do is create a copy of a string and then append to it
 
@VermillionAzure Make path a parameter then.
 
@wilx it's already implicit in the class
 
Xeo
@VermillionAzure [&, var, var ,var] says by-ref is the default, and everything explicitly named is by-value
 
@VermillionAzure No.
 
Xeo
[&var] says var is by-ref, no default
 
7:58 AM
@Xeo so you're telling me that [&, a, b, c], a b c are not captured by default by reference
 
Xeo
no
default in C++ is always by-value
 
@Xeo yes
i know that
that's why you put the & at the front right?
but no
 
@VermillionAzure: Like this maybe? coliru.stacked-crooked.com/a/6ef09745a96b6ad8
 
Xeo
@VermillionAzure Everything you explicitly name will have by-value or by-ref, depending on how you name it
[var] => by-value
[&var] => by-ref
 

« first day (1722 days earlier)      last day (3216 days later) »