« first day (509 days earlier)      last day (4657 days later) » 

12:04
@jalf They're actually referring to the SGXMP chipset, which actually is itself a multicore version of the SGX. I don't know the details of its' inner workings however, but I think it isn't comparable with traditional ATI/NVIDIA SPU-based chipsets, so maybe multicore does make sense for this chip.
morning
@RMartinhoFernandes quadcorner gpu!
@DeadMG morning, er, or something like that.
12:22
> Chess is a poor substitue for a real tactical combat wargame anyway. Why do clergy members only move diagonally? How can a random foot soldier get a field promotion to Queen?? Where are the terrain and weather modifiers???
man
I woke up today and my stomach was most unhappy
probably because I ate too much pineapple last night
I feel sad that I will from now on have to watch my pineapple intake
Is there are food you enjoy that doesn't hurt you?
yoghurt and STRAWBERRIES bitch!
also cookies and easter eggs, if eaten in moderation
and cheese!
CHEESE MOTHERFUCKER!
@DeadMG Have you tried domperidone? Here in Belgium it's commonly used to relieve upset stomach. The medication causes the stomach to empty itself by pushing the food down into the bowels.
uh, that sounds like it's only going to make things worse
I don't have a normal upset stomach
it's mostly my intestines, actually
12:36
Oh, didn't realize that.
12:47
> C++'s raison d'etre is backwards compatibility and the possibility to use all the dirty tricks that were possible in C. Take that away, and it's just another C#, D or Java clone. If you wanted that, why not just use C#, D or Java?
hmmm
will a constexpr function ever be excluded by a compiler as a no-op?
@DeadMG I think there are many who would not agree with that statement.
such as myself, who promptly laughed at it and told the poster what an idiot he was
@kmore what do you mean?
@kmore constexpr isn't really special in terms of optimisations
13:04
@awoodland if you have constexpr int squared(int num) { return num*num; } and the user's only call to squared() is squared(0);, will that result in the entire function being optimized out?
@kmore possibly if your implementation is smart and feels like it.
no reason why it can't, no reason why it must
@awoodland so constexpr operates here literally in the same way a template metafunction would?
thanks
If it can be evaluated at compile-time, it will.
0
Q: Performance When Extending Classes, Composition vs Polymorphism

Jens ÅkerblomWhen extending a class, is there any difference in performance between polymorphism and composition? Take the following example using composition (in C++): class Window { public: Window(Renderer &renderer) : m_renderer(renderer) { } void update() { ...

13:12
@DeadMG it's kind of basically sort of true. C++ is designed for backwards compatibilty. It would have looked very different, and would have been quite a lot cleaner, if it hadn't been saddled with backwards compatibility
except that C++, even without backwards compatibility, isn't quite intended as a C#/Java/D clone
@jalf That's my point.
C++ is most assuredly a stepping stone from C to "somewhere", but C#/Java/D is most definitely not "somewhere"
ugh, it's 8:30 AM; that means the asshole the floor above me starts hammering
you know
I had something I wanted to ask you about or ... something, but I've forgotten what it was
Xeo
Xeo
13:31
@RMartinhoFernandes, mind testing the snipper here with your Clang build?
Sorry, my build is broken.
Xeo
Xeo
:/
But I doubt it would compile.
Xeo
Xeo
I didn't build Clang in 2 weeks I think. This is gonna take a while...
vector<unique_ptr<string>> doesn't have a constructor from initializer_list<string*>.
13:36
which seems reasonable to me
What doesn't seem very reasonable is unique_ptr<string>.
I need some advices on my data structure design
@Xeo "Why is it not possible to use the explicit ctor?" Because it's explicit and if invoked it would be invoked implicitly?
I've got a tree of bones in my skeletal rendering system, and I need to access each bone across all objects at a time
but I need to store them as all bones across each object
or at least, provide access that way
say that again @Dead
13:39
isn't the mathematical constant e just beautiful?
@thecoshman sure
it represents the natural growth of things
presumably, each skeleton is a hierarchy of bones, and you have a root bone
yes
and the object interface allows you to change the S/R/T values of each bone as you like
13:40
and you want to be able to access which bones in what way?
I need to be able to access one bone across all objects
like, every object has the same skeleton, and I need to access all the left arms
> If you think you knows everything why can't you just change your name to Google
@TonyTheLion Is that a comment on a question/answer?
I see, so you want to be able to access a certain type of bone from multiple skeletons? with some sort of pattern as to which bone in the skeleton it is
yes
I need to submit them to the rendering pipeline bone-by-bone across all objects
13:42
I see...
@DeadMG nope
so I've been thinking something like
unordered_map<string, unordered_map<object*, per_bone_data>>
hmm... perhaps diagrams will help :P
lol
maybe I just spoke the answer
I still don't get what you are trying to do :P
13:46
0
A: Initializing container of unique_ptrs from initializer list fails. GCC 4.7 snapshot on linux

R. Martinho Fernandesunique_ptr's constructor is explicit. So you can't create one implicitly with from new string{"foo"}. It needs to be something like unique_ptr<string>{ new string{"foo"} }. The following should work. vector<unique_ptr<string>> vs { unique_ptr<string>{ new string{"Do...

Xeo
Xeo
I hope you already saw my comment? :P
4
A: Can I list-initialize a vector of move-only type?

XeoWe're gonna utilize a little helper type here: #include <utility> #include <type_traits> template<class T> struct rref_wrapper { // CAUTION - very volatile, use with care explicit rref_wrapper(T&& v) : _val(std::move(v)) {} explicit operator T() const{ ret...

Dammit, forgot that init lists suck.
Again.
Xeo
Xeo
For a workaround, btw.
Yeah, I know.
@Dead, so you have multiple instances of say a NPC skeleton, each instance is for an NPC of course. and you want to be able to send the left arm bones data for each instance of this skeleton, so you want to send say 50 left arm bones chains to render
13:48
yes
@awoodland There isn't a make_unique, but that was an accidental omission: herbsutter.com/gotw/_102
hmm... perhaps some sort of meta data on the bones, so you can say "skeleton.draw(leftArmBones)"
Hello all :)
@RMartinhoFernandes I saw that link after I'd posted the comment
can someone help me with this ? I am trying to call a method on all members of a vector , using a for_each loop, but I always get an error saying "error c2064 term does not evaluate to a function taking 1 arguments"
13:52
I went with unordered_map<string, unordered_map<object*, per_instance_data>>
Xeo
Xeo
@angryInsomniac No code, no help.
4
@sbi
Gorillas all have unique noseprints (like our fingerprints)
@Xeo You dig your own grave ;)
@DeadMG is this so you can have an object of this type that stores all the left arm bones of all the skeletons that are using mesh X
Xeo
Xeo
No, because I gotta go help some friends. :) Aka... afk!
13:54
@thecoshman No, because I can go giant_tree[bonename].begin(), giant_tree[bonename].end() to get all the instance data
at least, in theory, that is how it should work :P
@DeadMG what I mean is, you are copying references to these bones to a separate list.
@angryInsomniac Member function pointers are not function pointers.
for_each won't work with pointers to members directly.
Xeo
Xeo
Can't call member function pointers like that
13:55
std::mem_fn, I think.
Xeo
Xeo
Or lambda
@thecoshman Sure, but they're guaranteed to be alive for as long as the object is, and there's no other way to access them
or bind
Ok ... It seems I did something very obviously wrong , but I still dont know what , any place on the net where I can read about this ? or any suggested googling keywords ?
simple
do not ever use member function pointers because they suck horrifically
then you're fine
Xeo
Xeo
6
A: Passing pointer-to-member-function as pointer-to-function

XeoIf the only interface you have is that function pointer, then you're screwed. A member function needs a this pointer to be called, and if you have no way of passing that, you're out of luck (I guess the std::vector<std::string>* args pointer is what you get passed from the library). In ot...

13:57
@DeadMG So , I should loop through the members and call the method on them separately ?
yes
@DeadMG well... presumably you still have a list of the skeletons in you scene. Which I imagine is basically just the root bone, a normal bone with a few extra settins.functions
for_each(dependents.begin(),dependents.end(),std::mem_fn(&Resource::deactivateR‌​esource));
@DeadMG Sounds simple enough , thanks :)
@thecoshman Not explicitly, no.
at least, not from the perspective of the classes in question
Xeo
Xeo
13:58
@RMartinhoFernandes btw, std::mem_fn is C++11
std::mem_fun is C++03
lol
Member Fun! Now with extra pointer!
@Xeo Oh, I saw ::shared_ptr and didn't noticed the boost:: part.
Wait.
Xeo
Xeo
Anyways, afk
It's a shared_ptr.
Xeo
Xeo
Yeah, shared_ptr doesn't support member pointers
14:00
std::mem_fn supports smart pointers!
Xeo
Xeo
So, lambda it is :P
huh?
Oh, right, it calls ((*ptr).*fun)(...)
— (t1.*f)(t2, ..., tN) when f is a pointer to a member function of a class T and t1 is an object of
type T or a reference to an object of type T or a reference to an object of a type derived from T;
— ((*t1).*f)(t2, ..., tN) when f is a pointer to a member function of a class T and t1 is not one of
the types described in the previous item;
Xeo
Xeo
Well, still, std::mem_fn is C++11, and std::mem_fun sucks :P
@RMartinhoFernandes I feel like I should try to understand what this is , but I dont get it :P
14:01
@Xeo Umm , why exactly ?
@angryInsomniac Well, pointers to member functions can't be invoked like this: ptmf(o, a, b)
It goes like this: (o.*ptmf)(a, b) (or ((*o).*ptmf)(a, b) since you have shared_ptrs).
But std::for_each tries to invoke like the first form.
argh!
why oh why do I have to construct such a convoluted scheme :(
@RMartinhoFernandes Ok ! then how would it know which was the calling object ?
maybe I'll just return to my previous plan of arduously moving through all of the skeletons simultaneously
@angryInsomniac It's would be the first one.
14:03
well, are you not just 'caching' bones that you want to use with certain settings
In C++03, your best choice is probably to really just use a regular loop.
and by caching I mean, building a list of the bones
In C++11 you can use std::mem_fn which "fixes" the ptmf to be usable.
@thecoshman Yes, I need to build a list of every left arm, every right arm, etc
@RMartinhoFernandes Oh .. so the compiler somehow internally converts the code to say o.<member function call> wherever its a simple <member function call>
14:05
@angryInsomniac The problem is that it doesn't do anything like that.
If it did, it would compile.
I meant "std::mem_fn" does
@DeadMG so... vector<bone*>?
@angryInsomniac Ah, yes. That's basically what mem_fn does.
@dead though how you work out what bones to place in that list is a different challenge
@RMartinhoFernandes Cool :) But I still dont get why it , as stated so poetically by @Xeo "Sucks" ?
14:08
starting with all the roots per mesh
so, you have vector<bone*> leftArmBones and vector<bone*> rightArmBones etc.
@angryInsomniac Because PTMFs have to respect virtual functions in some fucked-up way.
@angryInsomniac Oh, it's not mem_fn (in C++11) that sucks. It's mem_fun (old one, deprecated, from C++03). Yes, there are two, and only one letter changes :(
if it wasn't for virtual/multiple inheritance, they would just be regular function pointers
@RMartinhoFernandes oh .. :) well then I shall stop my inquiries there :D
@DeadMG Umm , and that makes the virtual function tables un-ncessarily long and complex ? (Wild guess)
14:11
I suppose the "fun" in mem_fun is in the DF sense of "fun".
no, it means each PTMF needs a chunk of extra space than regular FPs
and in addition, it's not even consistent - the extra space required depends on how the class was defined or declared, if at all
as for why they need a different syntax, I am uncertain.
And it needs thunks to adjust pointers... It's a mess really.
@DeadMG I'll take your word for it and move on for now :) thanks
@Xeo std::mem_fn is TR1 ;)
oh fuckles, I need to get some more shit from the mesh
I hate 3D rendering :(
14:16
lol, fuckles
the only place where there's no such thing as a non-hyper-optimized interface
@FredOverflow Hmm, seems like it's C++03. It's listed in the deprecated section of the C++11 standard.
That was close!
@DeadMG hey, I'm learning some new Haskell parsing techniques. Would you mind if I played with your grammar?
of course not
14:18
@FredOverflow Hehe. They made a mess out of that.
I mean, it needs work done on it as a grammar, but hey :P
@RMartinhoFernandes Are you afraid DeadMG might get jealous if you played with his grammar? ;)
depends ¬_¬
@FredOverflow Well, I was not sure if he cares or not, so I felt it would be polite to ask.
what is your job?
14:20
@ScottW I would if you didn't start with "pls".
Feb 23 at 12:08, by jalf
nothing turns people off like a "pls help me"
well, that was closed fast :P
@ScottW where?
So... doing an intro to perl course in a few weeks... am I going to be suicidal after it?
What is Pearl? Do you mean Perl?
@FredOverflow what you on about !_!
14:32
@thecoshman Don't worry, typeglobs are easy.
@thecoshman deicide for yourself
@FredOverflow WTF
is that thumnail really showing code @a >>+<< @b
1>c:\repo\render\render\implementations\render\direct3d9\3d\scene3d.cpp(138): error C3480: 'Wide::Direct3D9::`anonymous-namespace'::<lambda3>::__this': a lambda capture variable must be from an enclosing function scope
1>c:\repo\render\render\implementations\render\direct3d9\3d\scene3d.cpp(138): error C2734: 'Wide::Direct3D9::`anonymous-namespace'::<lambda6>::__this' : const object must be initialized if not extern
1>c:\repo\render\render\implementations\render\direct3d9\3d\scene3d.cpp(138): error C2373: 'Wide::Direct3D9::`anonymous-namespace'::<lambda6>::__this' : redefinition; different t
VS Y U HATE ME SO MUCH
By the way, watched a 2001 Q&A session with Linus Torvalds last night, and he said he never uses a debugger, he prefers to stare at code. I think I'm in love!
@thecoshman It's an hyper plus.
14:35
@RMartinhoFernandes hyper plus ¬_¬ more like (╯°□°)╯︵ ┻━┻
(Not making this up, the » « things are called "hyper")
@DeadMG Can we see the source?
@thecoshman I don't know if that's actual Perl code or some meta-syntactic thingie. Just watch the video.
@RMartinhoFernandes are those doodads not the same as two chevrons?
And I think those are guillemets not double greater than/less than signs.
14:37
@RMartinhoFernandes chevrons bud, there called chevrons
Guillemets (, or from the French ), also called angle quotes or French quotation marks, are line segments, pointed as if arrows (« or »), sometimes forming a complementary set of punctuation marks used as a form of quotation mark. The symbol at either end – double « and » or single ‹ and › – is a guillemet. They are used in a number of languages to indicate speech. They resemble (but are not the same as) the symbols for lesser than, greater than (for the single to combine quoting and subscripting. %table<name> has the same meaning as %table{'name'}, and %table«name» has...
auto SetRenderTargetToDevice = [&] {
It's a metaop.
Can a lambda without parameters omit the parenthesis? Cool.
@FredOverflow Yes, it can, but not if you want to define the return type.
@RMartinhoFernandes Onebox fail :P
14:38
They still haven't fixed the HTTPS.
@DeadMG So it only works if the return type is void or what?
@FredOverflow Or deduced, I think. But I rarely use it if non-void
@FredOverflow Or if it can be inferred.
What you can't do is [] -> int {}.
That requires the empty parens.
> The Perl 6 programming language uses « » and < > to combine quoting and subscripting. %table<name> has the same meaning as %table{'name'}, and %table«name» has the same meaning as %table{"name"}.
@ScottW winner
so irritating because I finally just wrote all of my rendering code and it should all work and I was looking forward to debugging those fucking useless D3DERR_INVALIDCALL errors
@ScottW Why are there always boobs in the watch next suggestions?
@ScottW That's sexist. What about horny girls?
14:49
1
A: I dont want console to appear when i run c++ program

Cheers and hth. - AlfThere are two ways for a Windows program to produce a console window: The program is linked as a console subsystem exe, which is a request to Windows to always provide an associated console window. The program's code itself creates a console window. The first option, console subsystem, is by ...

^ ah.
@CheersandhthAlf That thing gets asked every week.
must be a duplicate somewhere?
@RMartinhoFernandes That seems like an arbitrary choice.
ohhh horny girls
I knew it!
Three minutes.
14:52
@RMartinhoFernandes No, what people usually ask is "I don't want console to disappear".
my sex radar still works :P
@FredOverflow Oh, maybe that's it.
Wait, the question doesn't make any sense. He prints to the console, but doesn't want the console to appear?
@FredOverflow Where does he mention printing to the console?
@FredOverflow I assumed he was expecting printing to the console vs not printing to the console to show/hide the console as required
14:56
Oh, the comments.
complete with iostream .h
This needed more visibility:
0
A: Can I list-initialize a vector of move-only type?

R. Martinho FernandesSince @Johannes only mentioned this in a comment, I'm making it an answer for greater visibility. This can be done simply by emulating initializers lists with arrays and move iterators: move_only m[] = { move_only(), move_only(), move_only() }; std::vector<move_only> v(std::make_move_iter...

@ScottW Old, pre-standard headers.
@ScottW there must be loads of books in libraries that still pre-date the first standard
As in more than 10 frakking years old.
either that or slides from lecturers that just don't care/know
14:59
It annoys the hell out of me if I have to tell people to move into the third millenium.
heh, this is a great question: stackoverflow.com/questions/9619151/…
can't help wondering why he's testing that
@jalf The answer is surprisingly simple.
that's sane too - very unexciting
@RMartinhoFernandes I notice these things, you know
15:12
Notice what?
Oh "frakking"?
the frakking
I like it.
It's my standard expletive now.
lol
it'll wear off after a little while
hard to keep using frakking whilst everyone around you is using fucking
15:15
0
A: i need help c++ array

FredOverflow how can I display all alphanumeric chars inputted on array k to array n and all non-alphanumeric on array t? I assume by "display" you mean "copy"? Just use a conditional: int ctr, nctr = 0, tctr = 0; // note how I explicitly set the counters to 0 for (ctr = 0; ctr < 8; ctr++) { ...

Does anybody understand the comment?
good, then I'm not the only one
15:17
Really, that looks like some output dump.
No words, no help.
@FredOverflow flagged
(I'd star that for symmetry with @Xeo's. Just saying)
15:28
stackoverflow.com/q/9620042/168175 - deleted now, but what's with the "my compiler is for C99" on a C++ question?
You know, C/C++...
> As for speed, if it can compute it in approximately 50 milliseconds on a 1GHz machine
0
Q: A way to find the nearest prime number to an unsigned long integer ( 32 bits wide ) in C?

ErklingAs per title, I'm looking for a way to find the closest prime number. Greater or less than, it doesn't matter, simply the closest ( without overflowing, preferably. ) As for speed, if it can compute it in approximately 50 milliseconds on a 1GHz machine ( in software, running inside Linux ), I'd b...

lol
lol @ tagline
How many primes are there in 32 bits?
Wouldn't it be feasible to just lay out a table beforehand and then binary search it?
I think so
Xeo
Xeo
@RMartinhoFernandes Starwhore :P
15:33
@RMartinhoFernandes that's what I was thinking
for puppy
:P
203280221... That's a bunch.
Xeo
Xeo
Hm. Clang ToT still refuses to compile that example, hmpf.
15:36
@Xeo Why do you expect it to compile?
Xeo
Xeo
Well, according to Clang's stack trace, it does explicitly initialize the.. oh, wait.
Damn, why the fuck does initializer_list<T> not have a converting constructor from initializer_list<U> -.-
@Xeo Why should it?
They're designed to suck, remember?
Xeo
Xeo
Well, std::vector<std::unique_ptr<T>> v{ new T(), new T() }; would work then :P
@Xeo But it shouldn't.
I don't want explicit conversions to become implicit behind my back.
Xeo
Xeo
Oho, C++11 standard's price went down, apparently.
15:41
Yay, I guess...
> Oho, C++11 standard cover's price went down, apparently.
FTFY.
Xeo
Xeo
Huh?
Buying the standard gives you little else than an official cover.
I yawned
I felt that this was information you all had to know immediately
posted on March 07, 2012

C++ defines an unsigned integer type, size_t, that is well-suited to storing array indices, or otherwise counting items that can fit in the computer's memory.

not a stupid question
2
Q: Unregistering a callback registered via register_callback()?

Paul J. LucasI'm using register_callback() to register a call-back function for iostreams as described in Standard C++ IOStreams and Locales, p. 202. However, neither it nor any documentation I could find say how one can unregister a call-back. Is it possible? If I were to zero-out the iword/pword I'm using,...

I can't find any way either to unregister the callbacks
15:45
WTF is register_callback? I didn't even know that existed.
@TonyTheLion Maybe registering a nullptr?
aarrghh function pointers!
how did that pass Standardization?
@DeadMG IOStreams. What else do you need?
@RMartinhoFernandes no because you can multiple callbacks registered, which it will call in reverse order of registration
@RMartinhoFernandes true.. :(
15:48
Argh, SO is captchaing me again!
haha, you've been captcaught!
And I ended up deleting the answer anyway...
man
I need to execute my code and watch it fail so I can fix the errors
but silly VS won't compile it :(
wtf would you need a StringRef for ??
15:51
it's for super-efficient referencing a string or a string literal
a constant reference to a string
hmmm but what about const std::string& str = "mystring"; is this not just the same?
@TonyTheLion StringRef can handle substrings.
I suppose. It usually goes like that.
@TonyTheLion No.
that one involves constructing a temporary std::string
StringRef slice (size_t Start, size_t End) const
15:53
I came across it here
0
Q: String (const char*, size_t) to int?

XTFWhat's the fastest way to convert a string represented by (const char*, size_t) to an int? The string is not null-terminated. Both these ways involve a string copy (and more) which I'd like to avoid. And yes, this function is called a few million times a second. :p int to_int0(const char* c, s...

That function creates a new StringRef that references part of the same string.
You can't do that with string& or string const&.
Xeo
Xeo
I want string refs. Or more generally, array refs. Or even more generally, I want friggin views in my standard. :|
lol, there's a LLVM frontend for Haskell supposedly
A backend, you mean?
Xeo
Xeo
@TonyTheLion It's basically a string that doesn't own its content.
@RMartinhoFernandes No, frontend, translating Haskell to LLVM IR
LLVM is the backend, and it only operates on LLVM IR IIRC
15:56
GHC calls it a backend.
LLVM (formerly Low Level Virtual Machine) is a compiler infrastructure written in C++ that is designed for compile-time, link-time, run-time, and "idle-time" optimization of programs written in arbitrary programming languages. Originally implemented for C and C++, the language-agnostic design (and the success) of LLVM has since spawned a wide variety of front ends, including Objective-C, Fortran, Ada, Haskell, Java bytecode, Python, Ruby, ActionScript, GLSL, Clang, Rust and others. The LLVM project started in 2000 at the University of Illinois at Urbana–Champaign, under the direction of...
Xeo
Xeo
@RMartinhoFernandes Yeah, it calls LLVM a backend, because LLVM is the backend.
@RMartinhoFernandes And? I'd expect any reasonably rounded well-implemented language to be written in itself
@DeadMG Well, LLVM is not in Haskell.
15:59
I'm going to go and purchase food
@Xeo So, what is the frontend?
toilet paper
@DeadMG That's not food.
Xeo
Xeo
@RMartinhoFernandes Whatever parses Haskell and transforms it to LLVM IR
@Xeo GHC parses Haskell and transforms it into GHC IR (which I think is C--).
Then it calls one of the C, NCG, or LLVM code-generators (aka backends) to generate the output.
16:28
Hello, sorry to interrupt, I have a very quick question, if a variable is declared unsigned without type is it presumed to be an int or just an arbitary length of bits, or something else?
@TomIngram I think it's presumed to an int
@TomIngram it's an unsigned int
@TonyTheLion & Praetorian, thanks just found it on cplusplus.com "Finally, signed and unsigned may also be used as standalone type specifiers, meaning the same as signed int and unsigned int respectively"
you can do a similar thing with long vs long int
16:49
@Xeo, btw, just remembered this not-at-all-exact-but-kinda-does-convey-the-idea-sort-of-definition-of-monad: "A monad is an overloaded semicolon".

« first day (509 days earlier)      last day (4657 days later) »