« first day (1205 days earlier)      last day (3967 days later) » 

12:00
Oh Boost, screw your lack of move constructors!
auto grammar = lisp_grammar<char*>{}; // error: call to implicitly-deleted copycon
user1804599
Y U NO lisp_grammar<char*> grammar;.
because auto
I don't understand the growing trend of using auto for everything
I often know I’m going to need a variable (should I say binding?), but not its exact type or initializer.
@rightfold Because Gotw #94
@Rapptz It’s easy. It’s objectively better.
12:03
top kek
Or sometimes I factor out an expression into a variable. I’m not going to figure out its exact type when I have a compiler…
So: easier juggling / editing.
user1804599
> It guarantees the variable will be initialized; you can’t forget.
user1804599
My compiler reminds me of this.
user1804599
> It is self-documenting to show that the code is explicitly requesting a conversion.
Xeo
Xeo
const does the same :p
user1804599
12:05
What conversion?
user1804599
> It is more symmetric and consistent, both with the basic auto x = init; form and with other parts of C++…
Xeo
Xeo
@rightfold whenever you don't use auto
I liked that GotW :/
user1804599
Do you also do data members as auto foo = T{}; then?
I wish people wouldn't start using it as an excuse to use auto everywhere in the world
Xeo
Xeo
12:05
can't
Kinda sucks.
@Rapptz Do more Haskell.
Fine, OCaml then.
@Rapptz They don't need an excuse.
user1804599
12:06
Scala.
Why
@DeadMG I guess.
user1804599
read context pl0x
Infer everything always
@Rapptz It’s not an excuse, the Gotw explicitly says to do that. (And it’s right)
user1804599
12:07
@CatPlusPlus irrelevant.
user1804599
58 secs ago, by rightfold
read context pl0x
user1804599
@KonradRudolph that is the excuse. :)
@KonradRudolph I know it did. Which sucks because the GotW was really good up until he brought up that Herbism.
Let’s not call it that.
12:08
@rightfold Not mine. I came to the same conclusion independently, it’s just easier to link to the (extremely well-reasoned) article than to rehash the arguments every time
@LucDanton You come up with a name then
@Rapptz Modern C++ declaration syntax
user1804599
Also, I am going to discard this project and rewrite it in Haskell.
@CatPlusPlus the opposite of Infer is Inferno.
13
user1804599
@StackedCrooked Malbolge has type inferno?
12:10
@KonradRudolph ? He's talking about "Herbism", i.e. "Weird things Herb Sutter says"
@rightfold TIL about Malbolge
user1804599
Although unit testing in Haskell is terrible and painful.
@Xeo: I'm guessing that when the bottom of the screen is solid lava, it's probably a hint to stop digging downwards.
It's 7:11 AM.
@DeadMG Yep.
You should steal stuff from NPC houses. It's fun.
Up until they're provoked and try to murder you anyway
Xeo
Xeo
just don't hit them
12:13
Some get provoked by the mere sight of a weapon
Xeo
Xeo
kill em
Murderer.
I just go to my ship with all the cool stuff I stole and decorate it.
@Rapptz I did.
they didn't seem to mind if I robbed their whole village right in front of their guards.
that injustice
i can't bear it any longer
imma watch some anime
Xeo
Xeo
@DeadMG you can steal their houses from under their feet and they won't mind
12:18
goddamn obsidian really takes some convincing to die
so how tough is that robot boss guy
Xeo
Xeo
12:41
hm, my leg still hurts. at this rate, I will starve because fuck leaving my bed like this
Ell
Ell
someone suggest to me a chicken meal I should cook
Xeo
Xeo
Xeo's meal
Ell
Ell
ahh I would if I could :/
curry chicken?
satay chicken?
Chicken cashew nuts? Honey chicken? Grilled chicken? Chicken & vegetables? Chicken & mushroom?
coq au vin
12:49
sounds good
> variant_base<U...>::template monovisitations<void, variant_detail::construct_visitor, variant_base&, variant_base<U...> const&, void*>::value[active_member]
How do I format that ._.
168-long line with indentation
Insert line breaks in random places vOv
Xeo
Xeo
@LucDanton can you break that up with aliases?
At best that chops up the >::value. I have to put that aside though, that code isn’t quite correct.
user1804599
I was implementing Soundex in Perl only to discover Perl already has it in its standard library. :D
13:03
TDD kata?
Wow. There are exactly zero usage example for qi::phrase_match online. Depressing.
I'm sure sehe can hook you up :D
Yeah but I don’t want to bother that guy the whole time ;)
try asking on SO, then he'll answer it ;)
and it won't be a bother because he'll get rep! :p
13:08
make sure you upvote the answer though >_<
… are you seriously trying to explain Stack Overflow to me?!
maybe you come off as a newbie :D
user3010322
@sehe Have you ever made a hardware-based Digital Signal Processor?
It is StackOverFlow - yes, one word. Just saying ... ~_~
user3010322
I finished the Final Project for one of my classes already, so what one of my professors wants me to do is make a DSP in like Raspberry Pi or something, and then have other students feeds sounds in my DSP so I can add things like Echo and Vibrato to the sound in Real Time.
@sudorm-rfTelkitty I don’t claim that.
Oo, speaking of which, for the first time I realised that "overflow" is written in the bold where as "stack" is not ...
Hey, it works.
parallel_visitations<variant_base, variant_base<U...>, void, variant_detail::construct_visitor, variant_base&, variant_base<U...>, void*>
    ::value[active_member](variant_detail::construct_visitor {}, *this, other, storage.address())
Almost not unreadable ._.
user3010322
Holy jesus fuck.
user3010322
13:24
Are you making your own boost::variant? o.0
@ThePhD so what were you up to last night?
user3010322
@melak47 Something not pretty.
I'm awake now, you can tell me. I won't get any nightmares :p
> using type = Ret(*[sizeof...(T)])(Visitor, Left, Right, Args...);
2
Totally legitimate.
13:29
@rubix_addict testing 1, 2, 3?
@LucDanton what's those [] ?
user3010322
IT'S EASY AS DO RE MI
user3010322
A B C, ONE TWO THREE BABY YOU AND ME GIIIRRL
@Abyx ah, an array of pointers
holy shit
-2
Q: Make me a moderator. Now. Please

user3231722I request moderator privileges so I can personally rename every article and response tagged as "C/C++" that gives only C++ code to "C++" and slap the writers upside the head. That is all.

bahahaha
:v
user3010322
13:38
@melak47 The jist of it is using assumptions of memory layout and getting a pointer to the current classes this. We then cast to void and then cast to the desired storage type. The assumption is that the deriving class will implement the necessary functionality (e.g., declare a member of the sizes asked for) and then use the base class to implement all hte necessary functionality.
wat.
yeah, wut
0
A: ERROR in sample C++ program

rockstartprogrammerAdd stdafx.h precompiled header file as first line of your cpp file, #include <stdafx.h> You may refer, http://en.wikipedia.org/wiki/Precompiled_header.

Dammit, think I've found a new "cause".
user3010322
For the case of Vector2/3/4<T>, everything is implemented in terms of a generic, member-less base class with functions on Vector<T, n>. This reduces a lot of duplicated code for having separate Vector2/3/4<T>, but allows the new Vector2/3/4<T> which derives from Vector<T, n> to define its own member names and variables (e.g., unionized swizzlers).
@LightnessRacesinOrbit closed for shouting in title?
user3010322
13:42
I think a more type-safe way to do what I've done is use a static_cast<TDerived&>( *this );, and then require every deriving parameter of Vector<TDerived, T, n> to provide a std::array member that can be directly accessed. Something like _res or whatever.
user3010322
(Basically, CRTP).
so
do I play XCom or Starbound?
user3010322
Neither!
user3010322
Or both, at the exact same time.
so your Vector<T,N> implements all the stuff, and you cast a Vector2<T> : Vector<T,2>'s this to Vector<T,2>, and call the member functions of that? or what
13:45
@melak47 no
looks to me like the only actual algorithm you need over the vector elements is fold.
user3010322
I cast the this inside the member functions of the base class (Vector<T, 2>) to the desired storage (an array of 2 T's). The deriving class just declares the variables to fit the desired storage.
that's pure insanity.
user3010322
It is.
user3010322
So I'm changing it to CRTP.
13:47
Also, "rock start programmer"? ARGH
doesn't this make the baseclass useless?
user3010322
The base class implements all the functions, so no.
I mean...if there is nobody deriving from it, it has no storage and it doesn't work :D
user3010322
@melak47 Yeah, that's a slicing problem.
Oh, and he's a code tag fairy. Must.. get... off... profile...
user3010322
13:48
It's going on the assumption it's derived from.
user3010322
Which is a faulty assumption.
I thought you had all the functionality in free functions anyway :p
@neagoegab Code in question is also written for ancient compiler. — rockstartprogrammer Jan 18 at 8:24
user3010322
I did, but I needed a size-agnostic version of all the functions.
why?
user3010322
13:49
Rewriting the dot product for Vector 2, 3, 4 was annoying.
user3010322
Same for length.
user3010322
Etc. etc.
user3010322
I needed a common implementation to get rid of cruft.
which completely doesn't require any of this stuff.
user3010322
Yes, up until you want to have nice syntax.
user3010322
13:50
Then you need to work around PoD rules and stuff to get unionized swizzlers.
unionized swizzles is not nice syntax, it's "I don't know what the fuck I'm doing" syntax.
T dot(const Vector<T,N>& l, const Vector<T,N>& r){T sum = 0; for(int i=0; i<N; ++i) { sum += l[i]*r[i];} return sum; }or something?
user3010322
@melak47 Yes. I did that for all my vector functions.
@melak47 There are other ways of doing it even if you want .x, .y, .z syntax.
@DeadMG yes. MSVC has an extension for property syntax! :p
13:53
that is not to which I was referring.
I figured :/
what is it then?
some kind of meta/proxy/thing?
functional
user3010322
I had .x, .y, .z syntax before. But due to the constraints of templates and C++, it made the class a non-aggregate, non-PoD.
which is totally not a problem unless you go batshit insane looking for unionized swizzlers that nobody actually needs for anything
@DeadMG ?
user3010322
13:56
The class is still non-aggregate, but at least it's a PoD now and can be garbage-init.
why would you want it to be garbage-init-able?
user3010322
Gabage-init means its PoD which means it can be stuck in another union.
@melak47 dot is a fold.
you could return std::accumulate(stuff); to implement it.
@DeadMG no, I mean the .x .y .z syntax
right, well it's more than possible to define a range over some member variables.
after that you just apply some generic range algorithms and you're done.
I admit that by not coming with any range tools by default C++ doesn't make this approach the easiest thing to do
but I'm planning on introducing at least basic range libraries into virtually everything that I write because it's just so fucking handy.
even the Wide compiler.
if I had init lists and ranges it would be a lot nicer and shorter in many places.
14:00
talk more about me
@LightnessRacesinOrbit you suck
Too much is starred in here now
Trying to find something in the star list would be basically impossible
user3010322
Ah, there we go
user3010322
Now it's much more type safe.
user3010322
The only UB is the unionized swizzlers, and I can live with that.
user3010322
14:05
No longer very nightmarish.
why do you need your vector inside another union though
it's so you can cowboy cast it isn't it!
user3010322
Nah. It's for the color definitions.
user3010322
typedef typename packed_color_type_of<RVector4<T>>::type packed_t;
union {
	RVector4<T> v;
	struct {
		T r;
		T g;
		T b;
		T a;
	};
	packed_t packed;
};
just....put the rgba things where you put the swizzlers? ._.
why are you discriminating against colors (and texture coords), why shouldn't they be swizzlable, too?
user3010322
14:16
I have RGBA (and associated swizzlers) already on RVector4. The problem is it introduces extra member variables onto the color class (cross, dot, length, length_squared), a lot of which don't make sense for a color.
user3010322
@melak47 They are. stuv, rgba are all swizzles params on Vector4.
user3010322
I mean, I can do the derive and just pretend the member variables don't exist.
just make them different types and be done with it?
I just think that garbage-init is a crappy property to have for a vector class. or anything.
user3010322
TVectorX<T> performs zero-init and all the goodies.
user3010322
14:19
RVector is mostly for implementation details.
user3010322
All the typedefs are based on TVectorX<T> (Vector2, 3, 4, Vector2i, etc.)
jesus, you're making this complicated o_O
dang, couldn't you have used IVector or details::Vector for the implementation details?
and TVector implements all the members, again? :D
user3010322
No, it just derives and then adds constructors.
14:20
so complicated
user3010322
vOv
user3010322
@melak47 I decided to get rid of the packed_t, and doing so eliminates all the extra stuff for RRgba<T>
user3010322
template <typename T>
struct RRgba : RVector4<T> {

};
RRgba?
user3010322
It'll have extra ugly member variables, but... vOv a vector2/3/4 is just like its color counterparts, I guess.
user3010322
14:24
@melak47 Same as RVector. Has a TRgba which implements the constructors, etc. etc.
what's the R stand for? Real?
because you can put in ints, too :p
user3010322
Real, Raw, I dunno.
user3010322
Just used a letter. I could call it DVector, but... Shrug.
now you just need a huge namespace Colors { const extern Color Orange; } etc :p
user3010322
Already have it.
14:27
then go paint with your vectors and rrgbas!
Mauve, Azure, Badious etc
GrassBlue
user1804599
Why is that a struct.
KawaimeeGold o.O
user3010322
14:28
Dunno.
user1804599
Make it a namespace, noob.
you must be joking o_O
user3010322
@melak47 KawaimeeGold and KawaimeeBlush were the colors I was ordered to place in the Engine by a certain someone.
user1804599
And make the colors constexprs.
user3010322
@rightfold VC++ vOv
14:29
that's more colors than my eyes can distinguish, @ThePhD
user1804599
@ThePhD clang vOv
user3010322
q_q How I want MinGW 4.9.0
but, ctp2013 has constexpr right
except in the stdlib :V
user3010322
14:30
Trying to keep it mostly 2013 compatible.
user3010322
Albeit I am compiling with November CTP
Pinging @sehe … some easy to earn reputation points here:
0
Q: Adapt class containing a string member as synthesized attribute

Konrad RudolphI’m trying to parse a character string into an attribute of a custom type symbol, which contains a std::string member. I thought I could use BOOST_FUSION_ADAPT_STRUCT here but that doesn’t work. If I declare the rule as rule<It, std::string(), space_type> it works. If I define it as rule<It, sym...

user3010322
Ooh, though @rightfold is right: now that I thinka bout it, putting it in a namespace makes it pretty awesome to use.
user3010322
using namespace Colors; // Awwwr, yeah!
nahh, using struct Colors; is fine :p
14:33
I don’t want upvotes, goddamnit, I want answers.
user1804599
@KonradRudolph +1
> -1: upvotes unwelcome
aw, that hurts
user3010322
@KonradRudolph You can never have enough upvotes.
it seems dishonest when a guy with 211k SO rep says "I don't want upvotes" ^^
5
14:38
> auto main() -> int {
moved to bin
@LightnessRacesinOrbit My god there is a very strong case of Stockholm syndrome here. Don’t defend C++’ crappy legacy syntax!
@KonradRudolph Replacing one not bad syntax with a horribly redundant one is bad.
@Griwes It’s not, though. Redundant, that is.
How is it redundant
@KonradRudolph I don't do it for the sake of it!
user3010322
14:42
Eh. auto main () -> int {} is just extra letters for you to type for no real end-benefit. I mean, unless you're pedantic enough to want all your functions to have the same syntax declaration. Than, uh, go for it I guess.
^
seems like a poor reason
I mean, I can sort of see why you'd do it, but I wouldn't
Apparently the standard is so broken that (in C++14) main() is the only thing that can't be just auto main().
user3010322
Doesn't really harm anyone.
user3010322
Doesn't really harm anyone.
But this is no reason for writing LONGER CODE, ffs.
14:43
idea so nice you say it twice
@ThePhD There is an extra benefit though. That’s the whole point. And that extra benefit is uniformity. C++ declaration syntax is a horrible mess with lots of different syntaxes. Reducing the diversity here is a definite plus
user3010322
Why did it post it wtwice? D:
user3010322
@KonradRudolph Well, okay. :D
Oh no 3 more letters can't have that long code
@CatPlusPlus The point is, int main() is just right. If it required effort to create shorter code, I'd agree with you. But in this case, it requires effort to write longer code, so you are writing longer code on purpose, which is silly.
14:45
I don't actually like trailing return types, so that doesn't help
but I know you guys are allergic to types
What I'm saying
is that length is the least important fucking thing here
user3010322
What I really wish is that they implemented a back-tracking parsing for the declarations.
@LightnessRacesinOrbit I’m not. I’m allergic to having different declaration syntaxes.
14:46
It also takes less effort to flatten all namespaces
And the code is shorter!
@KonradRudolph I only use one :)
a is a short variable name.
user3010322
E.g., you could use the parameters and arguments on the left hand side and it would try to pull things from the argument list if possible.
user3010322
That would be kinda cool.
14:48
@LightnessRacesinOrbit I doubt that. Or do you never use lambdas or function templates where you have to infer the return type?
@KonradRudolph I haven't needed to yet, no.
I write production code, not fanciful daydream hobbyist complexities
;')
user3010322
Does that face... have a nose?
0
Q: Global service registration and comma operator

PixarThere is a global function that registers services: // services call this to register upon creation extern void RegisterService(adapter::Service *s); Then somewhere in a .cpp file some service registers itself: // create the adapter and register with libecap to reach the host application stat...

head to head :)
@ThePhD of sorts, I suppose
@LightnessRacesinOrbit trailing
@TemplateRex I ahve the truth on my side
14:57
But Vlad will participate in the Special Olympics
user3010322
Bleh.
user3010322
Refactoring code to make it easier to work with is hard work. :c
user3010322
I should just write all my code in main and be done with it.
Btw, why not upvote the OP if you take the effort of answering?
user3010322
UGH
user3010322
14:59
I hate having 100+ rep.
user3010322
I should delete my old answer.
@TemplateRex Eh? The two are orthogonal concepts.
It's good enough to answer but not a great question
user3010322
@LightnessRacesinOrbit +1 for Vlad.
user3010322
Just to see you two even and head to head again. :D
15:01
@ThePhD pftf
Speak.
user3010322
Cmon baby, compile... you can do it...
apparently my exam is tomorrow not today
Exams on Sunday do seem a bit weird.
Maybe it's Christmas day where he lives.
Of course, and you open the exam on Boxing Day.
15:16
TIL about Boxing Day
@Lightness Races in Orbit Read one more my post, dummy. — Vlad from Moscow 2 mins ago
Flag?
user3010322
@LightnessRacesinOrbit Too much effort. ;c
do such trolls as you have good manners?! — Vlad from Moscow 1 min ago
He does it to himself.
wtf
@LightnessRacesinOrbit Sure. So what does it matter whether we kill old people in their beds or they die on their own? The end result is the same, right? — George Stocker 2 mins ago
Two days' suspension hasn't taught you any manners, I see... — Lightness Races in Orbit 6 mins ago
xD
oh god
vlad again?
15:27
of course
Erm..
@BoniTea not on Medicine studies
What's wrong with Vlad's answer?
oh wait, it's a global variable
@LightnessRacesinOrbit flag.
user3010322
How do you declare a variable in a namespace in a header and initialize it? (non-templated).
user3010322
Do you need to have a .cpp which initializes that variable?
@ThePhD If it's non-const then you have to declare it extern in the header file and provide the definition in the .cpp file.
hello children
user3010322
Ooh.
user3010322
15:45
I'm missing the extern.
@deadbeef how old are you to call us children, huh?
user3010322
There we go, now it's compiling right.
user3010322
@StackedCrooked Thanks! :D
user3010322
@StackedCrooked Also, do you need the extern if its const?
15:46
@BartekBanachewicz I'm 7
@ThePhD AFAIK const int (simple types) can be defined in the header. Not sure about UDT.
What is the difference between void and VOID
@deadbeef One exists. The other does not.
@deadbeef the second one is uppercase
VSStudio makes VOID purple, and the lowercase version blue.
So I'm assuming it means something.
15:47
@deadbeef What is "VSStudio"?
Voyager SuperSport Tudio
:)
Maybe you're using some header that defines a macro, or some other identifier, called VOID
Impossible to tell from the information not given
@deadbeef I hated that back when I used it.
@deadbeef purple is a preprocessor macro by default
right click on it and click go to definition
15:51
Ah, thank you.
void beef_retour(BYTE* address, BYTE* data)
{
	DWORD* destination = (DWORD*)address;
	_asm
	{
		mov destination, data
	}
}
am i doing this rite
no.
you are ussing assembly
it can't possibly be right
@GamesBrainiac Finally started watching Space Brothers three days ago. I'm already at episode 16 ^^

« first day (1205 days earlier)      last day (3967 days later) »