« first day (1648 days earlier)      last day (3292 days later) » 

12:00 AM
well the compilation will fail if you try to use a method that the class doesn't have
but you can make it a bit more explicit with sfinae
 
Just finished ep3. It did not fail to grasp my attention.
Very reminiscent of Akatsuki no Yona.
(Which is a good series. Not super good, just good.)
 
@Rapptz That checks for a function by name, but it doesn't check the return type or argumetns
 
Or maybe very good.
 
@Prismatic Exercise for you.
It's pretty simple.
 
12:07 AM
crtp and sfinae? My brain's gonna start leaking out my ears
I think all I gotta do is modify the bit where you have typename X = blah
 
oh hey NOW I get why declval is a thing
I never understood what the hell it was for
 
@StackedCrooked I can't into templates
 
The need for some kind of "typeof(x)" feature is not very far fetched imo.
 
12:19 AM
I understand decltype
I didn't get why declval was useful until I tried decltype(Class::Member)
 
decltype(std::declval<T>()) can be emulated with decltype(*static_cast<T*>(nullptr)). (Which is what I did before I learned about std::declval... Heh.. so embarrassing
 
But declval is better because declval in evaluated context is compiler error, while *static_cast<T*>(nullptr) is UB.
 
@milleniumbug Ha!
My edit invalidates your statement :P
I got you real good.
But anyway. You're right.
 
decltype(&Class::Member) works btw
I like to use std::result_of in these cases
much clearer than using declval
 
And dereferencing the null pointer is not really UB.
At least on all platforms I tried it results in immediate crash.
 
12:26 AM
I'd rather not get into this conversation.
 
Language lawyering on this topic can get pretty long, and the discussions get nowhere.
 
@Prismatic sfinae with std::result_of_t<decltype(&T::foo)(ArgT1, ArgT2, ..)>
 
(reminds me of LRiO vs Loki fight about "dereferencing")
 
I would have written my previous statement if it wasn't for alcohol intoxication. (So don't take it too seriously.)
 
12:28 AM
@Veritas Not SFINAE friendly until C++14.
 
Ok, ok.
 
okay typename std::result_of not that much of a deal.
 
No.
std::result_of wasn't SFINAE friendly at all until C++14.
 
now that you mention it I recall something like this
 
I know I abandoned std::result_of about two years ago. I don't remember exactly why though.
 
Oh. Found it:
Feb 15 '13 at 2:39, by StackedCrooked
Must be getting tired. Can't get this to compile.
 
that's not a function signature
decltype(foo) would work
not decltype(&foo)
or remove the pointer with std::remove_pointer.
 
@Rapptz am I overlooking something? (2:30 AM here and getting a little tired :) )
 
self-taught so not really used to working with old compilers and so I never have such compatibility issues. Good to know.
 
@StackedCrooked yeah sorry
decltype(&foo)() would probably do it
forgot result_of is kinda retarded
 
12:40 AM
Maybe reddit will help me :)
 
You know SO is doomed when you are afraid to ask such simple questions.
 
@milleniumbug Yep :)
@Rapptz Can you provide a fixed code sample?
I can't seem to get it right myself..
 
If Fn is a function or a function object type that takes ArgTypes as arguments.
If Fn is a pointer to a non-static member function, and the first type in ArgTypes is the class the member belongs to (or a reference to it, or a reference to a derived type, or a pointer to it), and the remaining types in ArgTypes describe its arguments.
If Fn is a pointer to a non-static data member, and ArgTypes is a single type that matches the class the member belongs to (or a reference to it, or a reference to a derived type, or a pointer to it). In this case, member type is the type of this data member.
I know you ppl don't trust cplusplus.com, but I think it's pretty neat
 
@StackedCrooked you need to pass a pointer to foo
 
12:49 AM
I do that in my edited post.
 
you also need another empty pair of parenthesis so result_of<decltype(&foo)()>
 
@Veritas oh...
 
@StackedCrooked Don't forget the extra parentheses.
 
Why can't I do:
 
I believe that's because of the partial specializations that it uses internally
 
12:52 AM
std::is_same<void(T::*f)(float),decltype(&T::Method)>::value
 
remove f.
you don't do std::is_same<int x, int>.
 
@Rapptz Thanks.
 
@Rapptz ah, typo.
^ Is that naive? I didnt use sfinae stuff
 
if you're already inheriting
just use std::is_base_of.
 
The inheritance isn't really that relevant, I should have left it out. Its just the method signature check that matters (the methods won't be the same / overriding)
 
1:01 AM
well it assumes that the provided type actually has a Member member function
 
yeah this isn't SFINAE friendly at all
it'll just fail to compile outright without triggering the static assert
 
@Rapptz good point
 
btw anyone knows if we are getting module support in the distant future?
 
C++17 is the plan
probably won't happen
 
rip
 
1:11 AM
lucpm will save us in the meantime
 
wut
 
lol
 
did you google it
I haven't worked on SEO™ yet
 
Taken by some twatter handle and few other wobsites
 
what cicada said
 
1:13 AM
lmao
 
Ah the cicada. Such a magnificent organism.
 
I am well aware.
 
I'm working on an event system
 
"Organism" is the word.
 
for my game about cubes
 
1:16 AM
ITT Rapptz invents Reactive Rubik's Cube
 
move like
"cube moves every so often"
I'm thinking of how to design this so I'm not a bad gamedev
 
pleonasm
 
I do that too. Then when I finally find the final solution I am not interested in the problem anymore.
 
1:38 AM
@Rapptz does this make sense: coliru.stacked-crooked.com/a/0dd5a22e055a6353
 
yes
 
returning the result of is_same is so cool
because its an integral constant and you can use ::value on it :D
 
I'd move is_same to the bottom
template<typename T, typename X = decltype(&T::Method)>
static std::is_same<int(T::*)(float), X> test(int);
 
Rapptz's approach makes the sfinae distinction more clear, I agree.
 
Well he did just adapt my example :v
 
2:15 AM
@Rapptz just wondering why do you need to check for active actions?
 
so you can react to it?
You need to know "Hey the Ctrl key is being pressed"
not sure if I misunderstood the question
 
it's like 5 am here so it's possible that I just didn't get the purpose of the Action class :P it's not big deal.
 
just something to encapsulate realtime/non-realtime events/keypresses/joystick/mouse etc.
 
@Veritas s/magnificent/loud/
 
yea i got that. What I don't understand is why you need realtime/non-realtime events. Just curious on what is to come.
 
2:25 AM
I just noticed I don't have operator!.
 
oh god this inefficient ecs implementation
I really need to finish that framework
 
I don't use ECS
it's there as proof of concept
I actually hate ECS
 
ecs is the most logical way to group game content for me
but I hate almost all implementations
 
it's the shittiest way to group game content
 
well it is when forced
 
2:31 AM
I understand the premise (and used it in Unity)
 
but it makes sense for a lot of things
 
but I don't like it
 
unity isn't really a real ecs
it's composition based
but not ecs
 
btw I'm assuming your "so inefficient" comment is about the use of std::map.
otherwise I don't see a problem with it unless you're one of those "I don't like RTTI" guys
 
rtti is fine.
 
2:35 AM
gonna have to elaborate then
 
I just don't like dynamic type dispatch
 
that's literally rtti
?!
 
well I don't like dynamic type dispatching for performance critical code. It's fine for me for many other cases.
 
not the performance
 
show me a way of doing it without inheritance
 
2:39 AM
I removed the static keyword from a bunch of member functions... unit tests still pass. No idea why I made them static :[
As usual, I guess I'll find out once I've made a ton of progress and it would be a huge effort to revert everything
 
damn
 
serves me right for not noting down why in the code I guess
 
I used entity groups which were basically groups of entities with specific components. The add_component member template sent a message to all entity groups for possible subscription/unsubscription. Then templated get_component member functions were guaranteed to work for entity groups with that specific component. The function itself is simply a call to the statically allocated component manager template. No virtual calls involved except from the subscription/unsubscription dispatch.
 
seems pretty meh tbh
especially "statically allocated component manager template"
not even sure what that does but it sounds like a singleton that "manages" resources?
n.b. the only "virtual" calls involved in my implementation is the virtual destructor
The System thing is just an example and not really robust because you can do the same without actually using it.
 
which is why I didn't implement a system class in my framework. A system is basically anything that acts on an entity_group. The only reasonable case to abstract the systems is if you want to parallelize parts of the loop.
 
2:55 AM
silly
 
which part is silly?
 
"System" is a crappy name
 
I agree
 
ikr
I still hate ECS
 
makes sense for me. If you have mass you are affected by gravity. If not you are not. No reason to waste computation and memory for something that never is affected by gravity.
Then you say split the objects. keep those that are supposed to be affected by gravity separated. Then do that for feature A, B, C but then they overlap. You are then forced to take an ecs approach.
 
3:01 AM
I am also making an ECS
Kinda wish I had stuck with an all-in-one scene graph
 
the only thing I'd change about my implementation is a sorted vector instead of a map
 
inherently inefficient because of cache misses when it comes to accessing different entities. Even worse that it uses std::unique_ptr for each different component but a better solution than std::map because of pipe-lining. Of course this is all fine if the game is small without a lot of objects and probably a better time investment.
 
The std::unique_ptr is because Component is polymorphic.
I'm still not sure how to implement it without polymorphic behaviour.
Your anecdote back then didn't really help there either.
Looking at other implementations they're pretty meh.
Tightly coupled to their cute little monolithic "EntityManager" or "World".
Just serves as a reminder why I avoid looking at gamedev code.
 
You'll have a world anyway so who cares
 
this is why I used component_manager. The component_manager template models a contiguous homogenous collection of components and provides get_component(id) and has_component(id) that are wrapped to the entity.get_component and entity.has_component template members. These are necessarily static but it's fine since they are invisible to user code.
 
3:12 AM
manager
 
meh
 
mapper may be a better name
 
@CatPlusPlus My own world. Not some library's.
 
Who cares
 
I do.
Obviously I wouldn't be mentioning it otherwise.
 
3:13 AM
Programming is about realising that crap like that doesn't matter
 
Thanks for the sage advice.
 
jesus I'm so behind schedule on everything, also barely 50 hours this month
 
The source of Neovim is scary
Also why is Github suggesting me repos "made in Africa" why is this relevant at all
 
Wonder why, Momo.
 
I don't think there's anything in a software application that pisses me off more than shit that's intrusive and tries to take control of what you're used to doing
 
3:20 AM
I need to figure out monitoring and orchestration for production rip me
 
KDE has this annoying thing password manager thing that fucking pops up for every little thing
and its broken and buggy and doesn't work and you can't turn it off
I can just imagine some dude actively saying "Yeah, lets remove the option to turn it off. This is a great idea, nothing could possibly go wrong"
 
I can see how that might be a problem if you're used to writing passwords down on postit notes
 
@Cicada 2spooky
 
Its a problem because it doesn't fucking work. It doesn't remember any user names or passwords you give it, it freezes and crashes, and its garbage. I don't want it popping to prompt me for shit when I'm trying to push to github through bash.
 
Shoulda used Vim as your pw manager
 
3:23 AM
I should just buy a flipping mac. Screw these stupid DEs
 
Shoulda configured SSH
How did I end up being the only person doing this infrastructure shit
 
The rest died in the attempt
 
That's what I should've done
 
now add a message bus and all is set
 
Message bikes are more environment friendly
 
3:37 AM
Soup can with strings are. Less methane.
 
Soup can with C strings are null-terminated.
 
am I the only one that thinks we're doing ourselves a massive disfavor by investing so heavily into Javascript?
 
you're never the only one
 
I'm shorting Javascript. The bubble will burst.
 
I've forgotten how bad the SFML Joystick API is
Somehow the crappyness of SDL has spoiled me.
 
3:40 AM
I really hope Javascript dies sooner than later
it's a terrible language that shouldn't be used as the infrastructure to build upon for scripting the web
 
Graph of JavaScript popularity over the years
 
since we have variable templates, would it be a good step to also get member variable templates or would that be completely horrible ugly and wrong?
 
@Rapptz no description on axes -1
 
market share on y axis, year - 2010 on x axis
 
people who believe Javascript is popular because of it's merit are misguided
it's popular due to a lack of competition
 
3:43 AM
Dart
 
And it's most likely not going away
for quite some time
 
@Rapptz dart is just a frontend for... javascript
people are 'compiling to javascript', which is just backwards and wrong
not because javascript is so great to target
there's just no fucking alternative
 
@orlp It's popular because the entry barrier is low
 
@Cicada wrong
it's popular because there is no alternative to run client-side code
 
Okay carry on then
 
3:45 AM
Obviously you don't remember what happened when they announced the Dart VM idea.
 
@Rapptz Dart VM? that's another step backwards
 
your genius analysis is misplaced
 
browsers need a portable assembly specification
that any language can target
not just dart
 
also lol
> Microsoft's JavaScript team has stated that: "Some examples, like Dart, portend that JavaScript has fundamental flaws and to support these scenarios requires a 'clean break' from JavaScript in both syntax and runtime. We disagree with this point of view."[27] Microsoft later released a JavaScript superset language, TypeScript.[28]
always worth a couple of chuckles
 
basically what you want is a technology similar to the JVM
but not tied to a language
 
3:48 AM
you're part of the problem
 
define 'the problem'
 
fuck web apps
keep your fancy JS usage out of here
 
I think web apps have their merit
 
and yeah I know it's 'ironic' considering I'm using SO chat
 
but I can agree with your sentiment on some level
I think web apps are over used
but that's not the reason why I'm advocating against Javascript
 
3:50 AM
your silly portable assembly specification will only perpetuate the issue
 
I'm advocating against Javascript, because I don't want it to get critical mass.
 
Your mom has critical mass.
 
the more we invest into javascript, the shittier the future becomes
we don't want to build our next decade of infrastructure on top of the shambles that is javascript
 
LLVM could come close with the appropriate constraints.
 
@orlp I don't hate every web app
I think Cicada is right
JS is popular because it's easy
You can do a lot of things in JS without much effort because you have the entire backend of the web to aid your tasks.
e.g. doing a GUI in C++ is more complicated than just a web page + JS
 
3:58 AM
my point is is that javascript is popular because it's the only option for that
you can't do web page + Python
if you could, everyone (sane) would dump Javascript like a used condom
 
your "portable assembly" is basically JS though
just use a language that compiles to JS
 
except it's not
 
there are thousands
 
that's the terrible part
javascript is a TERRIBLE base language for this
it's an incredibly bad compilation target
 
you're not creating the transformation though
someone else already did that work for you
 
4:00 AM
I'm not talking about that part
javascript is not even remotely representative of what a modern CPU does or can do
as such, it's just plain unfit as a compilation target
not to mention the hackyness
 
it's not running on your CPU explicitly
it's running on your browser
 
and the browser is running on?
a javascript engine?
no, the CPU
 
I'm glad you can't read and all
 
Which CPU?
 
4:04 AM
@Rapptz doesn't have 64-bit integers
 
If it is running "in your browser" it is running on your CPU. Whether interpreted ot JIT.
 
every fucking CPU these days is 64 bit
it's a misguided attempt to salvage JS
to try and turn it into what an actual portable bytecode should be
 
@orlp Hardly. It's mostly an attempt at keeping chip sizes large enough to keep their average selling price from falling through the floor. Adding more cores is pretty much the same. The reality is that if they sold something that was essentially (for example) a Pentium Pro on a modern fabrication process, their price would probably be around $10-20 at best, and neither Intel nor AMD wants that, so they use up as many transistors as necessary to keep the chip size around 100 mm2.
 
@JerryCoffin what?
 
He misread your comment
 
4:09 AM
I'm more curious what he read instead of Javascript for 'JS'
 
@orlp I'm talking about why they build 64-bit CPUs.
 
@JerryCoffin What was 'Hardly' reacting to?
 
Universal asm has been the holy grail for 40 years.
 
@RichardPennington yet literally anything is better than javascript
 
4:16 AM
Of course, as long as you understand the target ( or targets)..
Machine code is not that hard.
Especially with the tools we have today.
 
> Technically, your code is vulnerable to overloaded comma operators, but few libraries outside of VC's STL are hardened against that (not sure about libstdc++/libc++).
This humble brag by STL lol
what was I doing..
oh yeah joysticks.
 
@Rapptz VC?
 
Visual C++
 
hmm, reminds me
I should profile pdqsort against it
 
There are other processors besides the x86/.
 
4:21 AM
I'm fully aware
x64, ARM, ARM64, SPARC, (hopefully soon Mill), PowerPC, MIPS, Alpha, etc
 
I didn't want to imply that you weren't. I'm a tool builder. ellcc.org/blog
 
@RichardPennington gief lld pls
 
The only reason I dropped Alpha was that the LLVM project did.
I do keep the Microblaze for historical reasons.
 
@RichardPennington I'm working on a toy CPU to build challenges for codegolf.stackexchange.com
 
C/C++ :v
 
4:40 AM
looks like VS2013's STL std::sort isn't that hot:
 
@Rapptz That’s not how I take it.
 
Do you take it warmer?
 
5:08 AM
@Rapptz ?
 
bad joke
 
5:23 AM
lol :(
The SFML Joystick API is so bad!
I get that's what I get for using SFML again.
Mediocre joystick/game controller support.
It seems SFML uses winmm instead of XInput or DirectInput.
Worst of both worlds.
SDL can use all 3 depending.
 
Whoah whoah whoah, you can switch (SomeEnum) { case SomeOtherEnum::Value: ... }
 
Cinch?
 
@Cicada You can also add them together and store them into an integral type variable.
 
What happened to poor Cinch anyway?
@Cicada You can switch(my_char) { case 'a': ... } too.
 
@Rapptz You can switch(my_char) { case 3: … }.
 
5:31 AM
@Rapptz I think he meant SomeOtherTypeOfEnum.
 
@MarkGarcia I know.
It's in the text.
 
Of course he wouldn't name a variable in UpperCase!
 
I feel like I wasted an hour of my life to this joystick thing
I'm upset over this.
:(
 
How do you test it?
 
it works just in a very meh way
mainly w.r.t. RT/LT on DirectInput and XInput
I tried 3 controllers (Logitech F310, Xbox 360 Controller, and my PS3 controller)
gist of it is don't expect the shoulder triggers to be their own separate axis on DirectInput (they're buttons instead, 6 and 7 for left/right respectively) and not to be shared on XInput (they're an axis (Z) but it's shared with the two buttons)
 
5:53 AM
@LucDanton This is terrible
I just got bitten by something like that
 
I don’t think I ever use unscoped enums in C++.
 
It's an enum class
 
Then you can’t add them together.
 
VS joyfully allows me to switch on unrelated enums
 
that's fine
adding isn't though
 
5:57 AM
@Rapptz is it?
 
@Rapptz It's not fine!
 
@LucDanton Interesting.
I thought for the switch to work it'd convert to the underlying integral type.
Guess they special case enum class like everything else in C++ :v
 
But then wouldn’t it for operators? That’s how it works for unscoped enums, it’s promotion.
 
That's what VS does, actually.
You can switch on as many different enums as you want, as long as the values don't overlap
good job
 
I would love default operators for enums
 
5:59 AM
@Rapptz class is also special-cased from int!
 

« first day (1648 days earlier)      last day (3292 days later) »