« first day (841 days earlier)      last day (4109 days later) » 

9:00 PM
@ThePhD Your rvalue overload in the setter is broken. It copies.
 
decltype is a part of symantic analysis. the compiler is already evaluating the result type of every thing in the program, why not let the programmer use it
 
technically it's a syntactic production
 
@R.MartinhoFernandes Whaat? D:
 
@rici A call to typeid is indicated by a syntactic production. It is not exclusively a syntactic production.
 
@doug65536: the programmer can use typeid
 
9:00 PM
@doug65536 Right, but it is still a function.
 
typeid gets you a string
 
user142019
@doug65536 Bullshit.
 
@Zoidberg This.
 
user142019
std::type_info is not a string nor does it represent one.
 
"The result of a typeid expression is an lvalue of static type const std::type_info "
 
9:01 PM
look at the type_info interface. name(), that's it
 
@doug65536 It offers a lot more than just a string.
 
user142019
Yeah it has some member functions, one of which returns a string.
 
type ordering and hashing too
 
user142019
Doesn't mean it's a string.
 
@rici Pretty much everything you write into a C++ program is a syntactic production.
 
user142019
9:02 PM
That's like saying that in Java every object is a string since it has toString().
 
@rici IOW, it's a semantic entity, an expression.
 
@R.MartinhoFernandes I looked it over and I can't find it. :c
 
@Zoidberg tell me what you use typeid for then
 
@R.MartinhoFernandes: that's true, but a function call is a particular syntactic production, regardless of which function it happens to be.
 
user142019
@doug65536 I never use it.
 
9:03 PM
whereas operators, sizeof and typeid are specific productions
 
@Zoidberg exactly - it's useless besides maybe a hacky use of it for logging
 
I see the words, but I fail to see the point.
 
@rici You're wrong.
operators, for example, may be overloaded, and user-defined.
 
operators can cause the evaluation of a named function
 
those are functions.
 
9:03 PM
but they don't have to.
 
@doug65536 If you use typeid for getting a string, you are doing it wrong. (Hint: the string can be "" for all type_infos)
 
user142019
There are probably uses for it, but often it indicates wrong design.
 
I never switch on the type of an object so why would I ever do that
 
@DeadMG: overloaded operators are functions, yes.
 
all operators are functions; they just have special syntax (and primitive ones occasionally have strange rules in addition).
 
9:04 PM
Of all the things typeid gives you, the string is the less useful one.
 
C++0x, AFAIK, introduced type_index, which is hashable.
 
std::is_same<T,U>::value ?
 
Which may be far more useful than type_info.
 
I honestly don't understand why they did not just slap the operators on type_info.
 
anyway, my point was that decltype and typeid, despite their visual similarity, are categorically different, as in they're in different categories.
 
9:07 PM
one operates at compiletime and the other at runtime.
 
if they're functions, why don't you show me how to implement decltype in C
 
@R.MartinhoFernandes I still can't find that copy. Every instance of T&& in the property code I've written - as far as I can see - has a std::forward<T> on it.
 
typeid gives you something you can use at runtime, whereas decltype is effectively a macro-substitution
 
@rici No.
 
@ThePhD type_info is hashable too.
 
user142019
9:07 PM
@doug65536 see the source code of a C++ compiler written in C and voila.
 
type_index is just a weird wart that I can't explain.
 
@rici decltype is a compile-time metafunction in it's own right, it is not a macro substitution.
 
Most implementations provide a hash_code on type_info, but type_index is the standards-compliant hashable one.
 
@ThePhD hash_code on type_info is mandatory.
 
@DeadMG: distinguish the two cases, then.
 
9:09 PM
@R.MartinhoFernandes But it's not std::hash<>-able by the standard.
Only type_index is, though I doubt most implementations will leave type_info out of it.
 
user142019
I'd say it's similar to how std::vector could be a function that takes a type as argument (e.g. int) and returns a type as a result (e.g. std::vector<int>). The syntax is then angle brackets instead of parens.
 
@ThePhD Yeah, for no discernible reason.
 
Well, the C++ standard does a lot of weird things sometimes. Things I question greatly but am not smart enough to go and crash their committee and change the rules about.
 
user142019
[] :: * -> * yay kinds. :D
 
@rici decltype instantiates templates and performs overload resolution. Do that with a macro substitution.
 
9:11 PM
@rici First, macro substitution results can't be stored as variables, effectively, nor can they have further computations performed on them, whereas types can.
second, macros are hideously unsafe in every respect imaginable, and decltype isn't.
thirdly, the C++ template system is Turing-Complete and the preprocessor is not.
 
@DeadMG: you can bind macro substitution results to macro parameters.
 
@DeadMG since we're all extending bullshit terminology from other fields, I'd say typedef lets you make a variable and it's value is the type
 
and please find me a reference anywhere which requires functions to be part of a turing complete system
 
user142019
Stop talking about macros they're terrible oh God.
 
user142019
9:13 PM
Also s/macros they're/C++ it's/.
 
@doug65536 It's a constant.
 
@R.MartinhoFernandes Really? That's what you put into containers.
 
variables can be constant
or is static Foo f not a variable?
 
@rici But you can't store them anywhere, or refer to them.
 
@LucDanton I don't understand why that cannot be type_info. It has all the same functionality, just the wrong interface.
 
9:14 PM
where can you store a decltype?
 
@doug65536 It basically is, in the functional aspect of it.
 
user142019
@R.MartinhoFernandes type_info is uncopyable. You'd need to store pointers to them (which you can do), or std::reference_wrappers maybe.
 
you can certainly refer to them.
you can even stringify them
 
@rici As a type, i.e. using t = decltype(...);.
stringifying them isn't really relevant
 
because it's inconvenient to your argument?
 
user142019
9:15 PM
wat
 
uh
no
how is it even remotely relevant?
 
@R.MartinhoFernandes Presumably to avoid breaking changes. std::type_info are expected to be implemented as program-wide cookies most of the time I assume. It's true we could have started with a moral equivalent of std::type_index from the beginning, yeah.
 
turing completeness is irrelevant too, but that hasn't stopped you from using it
 
user142019
Pro tip:
 
user142019
 
9:15 PM
@rici Turing Complete systems are composed of functions.
 
user142019
TROLL SOLVED
 
if it's TC, then you have nothing but functions.
decltype is just a primitive of that system.
 
what about the true definition of function? a real function only has one possible output for any given input, right?
 
user142019
What's a real function?
 
@doug65536 I think so. Been a while since I did that stuff.
 
9:16 PM
@Zoidberg f : R -> R
 
@Zoidberg A function that outputs real numbers.
 
user142019
@R.MartinhoFernandes ah. :P
 
but decltype most assuredly maps expressions to types.
 
@R.MartinhoFernandes What's wrong with its interface? Not being the result of typeid?
 
for example, sin isn't a function unless you restrict the domain to -pi to +pi
 
9:17 PM
@doug65536 Wrong.
 
@doug65536 Uhmm.. Yes it is a function.
 
you've got input and output the wrong way around.
 
sin is a function
 
sin always outputs one and exactly one thing for any input.
nobody said that thing had to be unique
 
@rici @rici wow, that's a convincing argument
 
9:17 PM
something like a hyperbola is a example of something that's not a function.
 
@LucDanton No, I meant the interface of type_info. It lacks op<. And copies, apparently.
 
but it's a function even if it is not in a turing complete computational environment.
 
@R.MartinhoFernandes Yeah. Not much of an abstraction.
 
for example, a spreadsheet without cycles is not turing complete, but includes sin
 
I know
 
9:18 PM
@DeadMG you should lookup what function means in mathematical context
 
In mathematics, a function is a relation between a set of inputs and a set of permissible outputs with the property that each input is related to exactly one output. An example is the function that relates each real number x to its square x2. The output of a function f corresponding to an input x is denoted by f(x) (read "f of x"). In this example, if the input is −3, then the output is 9, and we may write f(−3) = 9. The input variable(s) are sometimes referred to as the argument(s) of the function. Functions are "the central objects of investigation" in most fields of mod...
 
@doug65536 You give it some things, and it gives you back some other things, and if you give it the same things, it gives you back the same things.
 
> In mathematics, a function is a relation between a set of inputs and a set of permissible outputs with the property that each input is related to exactly one output.
 
right, that's a function. not a word about turing there
 
That's exactly what the sine function does.
 
9:19 PM
A function is a monic homomorphism in some category (sets?).
I think.
 
user142019
Functions are the morphisms of the Set category.
 
@rici decltype also meets that description just fine.
 
@R.MartinhoFernandes What are arrows in sets?
 
you give it an expression, it gives you back a type, if you give it the same expression you'll get back the same type.
 
user142019
@LucDanton functions.
 
9:20 PM
yes, it does. in a mathematical sense, in the metalanguage of c++ templates, it's a function.
 
user142019
In the mathematical field of category theory, the category of sets, denoted as Set, is the category whose objects are sets. The arrows or morphisms between sets A and B are all functions from A to B. Care must be taken in the definition of Set to avoid set-theoretic paradoxes. Many other categories (such as the category of groups, with group homomorphisms as arrows) add structure to the objects of the category of sets and/or restrict the arrows to functions of a particular kind. Properties of the category of sets The epimorphisms in Set are the surjective maps, the monomorphisms are th...
 
@LucDanton Relations or functions. Not sure.
 
but it's not a function in the c++ runtime sense of a function.
 
what the fuck do I care about that?
I never said it was a runtime function.
I just said it was a function.
 
you cannot cast it to std::function, for example.
 
9:21 PM
which it is
 
user142019
In Set, objects are sets and morphisms are functions.
 
@R.MartinhoFernandes Has to depend on authors I think. Haven't seen much relations in CT.
 
@rici Who cares?
 
@Insilico: the original point of all this is that decltype and sizeof are in different categories.
i claim that typeid is like sizeof
but decltype isn't
 
@rici FWIW, that isn't the "C++ runtime sense of a function" either.
 
9:22 PM
but, in the wider sense, who cares? nobody.
 
anyone who understands how a compiler resolves expression types will immediately understand why sizeof and decltype are almost identical
 
@R.MartinhoFernandes: i never said it was.
 
@rici Well, it isn't, since sizeof can also be used at compile-time.
 
so can typeid
however, with implementation-defined semantics
 
I don't remember the Standard defining typeid at compile-time.
 
user142019
9:23 PM
Which raises the following question, since I suck at maths: is 42 = {42}?
 
user142019
Where {} is set notation.
 
@Zoidberg No.
 
no
 
no.
 
user142019
oh.
 
9:23 PM
{42} is an element of 1
 
{42} is a set that contains only one element.
42 is a scalar integer.
 
Ell
isn't 42 E {42} or soemthing?
 
upsidedown U thing
 
at least , in the definition in Principia Mathematica
 
user142019
@Ell Reverse the E. :P 42 exists in {42}.
 
9:24 PM
@doug65536 That's intersection.
 
Ell
Oh
 
ell, no: 42 is the set of all sets with 42 elements, so {42} is not in that set
 
wait ya sorry it is the E thing
 
Ell
42 ∈ {42} ?
 
In mathematics, an element, or member, of a set is any one of the distinct objects that make up that set. Sets Writing A = {1, 2, 3, 4 } means that the elements of the set A are the numbers 1, 2, 3 and 4. Sets of elements of A, for example {1, 2}, are subsets of A. Sets can themselves be elements. For example consider the set B = {1, 2, {3, 4}}. The elements of B are not 1, 2, 3, and 4. Rather, there are only three elements of B, namely the numbers 1 and 2, and the set {3, 4}. The elements of a set can b...
 
9:24 PM
@Zoidberg It is correct.
 
@Ell Yes.
 
user142019
@R.MartinhoFernandes oh damn I was confusing it with this:
 
user142019
 
user142019
lol
 
@Zoidberg That doesn't really make sense.
 
user142019
9:26 PM
no wait reverse that.
 
user142019
I suck.
 
It still won't make sense.
Unless 42 is a variable.
 
user142019
 
Here's a fun operator: the D'Alembert operator
In special relativity, electromagnetism and wave theory, the d'Alembert operator (represented by a box: \scriptstyle\Box), also called the d'Alembertian or the wave operator, is the Laplace operator of Minkowski space. The operator is named for French mathematician and physicist Jean le Rond d'Alembert. In Minkowski space in standard coordinates (t, x, y, z) it has the form: : \begin{align} \Box & = \partial^\mu \partial_\mu = g^{\mu\nu} \partial_\nu \partial_\mu = \frac{1}{c^{2}} \frac{\partial^2}{\partial t^2} - \frac{\partial^2}{\partial x^2} - \frac{\partial^2}{\partial...
Only because the symbol for the operator is a box.
 
user142019
There exists an x in {42} such that x = 42.
 
9:26 PM
And thus it's hard to tell if it's just my browser not able to render the font.
 
I see numbered glyphs for stuff that is missing.
@ThePhD line 20 in the code you posted.
 
Ooh.
I need a std::move
A named r-value is an l-value, Cat said.
Alrighty, all fixed.
 
Is it me, or does a new tag gets added every time someone changes the topic?
 
We should have a [no-new-tags] tag.
 
Only every three changes.
 
9:32 PM
Ah.
 
@ThePhD I said, but it's also correct.
 
@EtiennedeMartel Unlike questions, it seems that tags for chat rooms have a much higher (or non-existent) maximum
 
room topic changed to Lounge<C++>: For the three thousand and fourty fifth time: not a helpdesk. [c++] [c++11] [c++-faq] [get-out] [no-limit] [no-love] [no-pointers] [no-questions] [no-singletons] [no-topic]
 
No love?
 
room topic changed to Lounge<C++>: For the three thousand and fourty fifth time: not a helpdesk. [c++] [c++11] [c++-faq] [get-out] [no-limit] [no-love] [no-money] [no-pointers] [no-problems] [no-questions] [no-singletons] [no-topic]
 
9:35 PM
No money?
 
no-problems
 
user142019
Can I provide a generic instance for any type belonging to a specific typeclass? E.g. instance Monoid m => Foo m where?
 
user142019
Those tags. lol
 
C99 problems, but a bitch ain't one
5
 
9:36 PM
room topic changed to Lounge<C++>: For the three thousand and fourty fifth time: not a helpdesk. [c++] [c++11] [c++-faq] [get-out] [no-limit] [no-love] [no-money] [no-pointers] [no-problems] [no-questions] [no-singletons] [no-tags] [no-topic]
 
@Zoidberg Yes?
 
user142019
Aight thanks.
 
We disallow quite a lot of things in here.
 
room topic changed to Lounge<C++>: For the three thousand and fourty fifth time: not a helpdesk. [c++] [c++11] [c++-faq] [get-out] [no-limit] [no-love] [no-money] [no-pointers] [no-problems] [no-questions] [no-singletons] [no-tags] [no-thephd] [no-topic]
 
why aren't arrogant and condescending in the tags? :P
 
9:37 PM
room topic changed to Lounge<C++>: Oldspeak not permitted. [c++] [c++11] [c++-faq] [get-out] [no-limit] [no-love] [no-money] [no-pointers] [no-problems] [no-questions] [no-singletons] [no-tags] [no-thephd] [no-topic]
 
@doug65536 That's already covered by the tag
 
fuck
I'm playing Mafia, and I got the role of prostitute.
 
@Insilico oh right, my mistake
 
@DeadMG Is that good?
 
no, not really
when I play the other roles, I like to imagine myself brutally murdering people
but it's difficult to imagine myself giving some other guy a really good blowjob so that he doesn't go off and kill someone else.
 
9:39 PM
=[
q_q I'm not allowed in here.
 
I mean
 
q_q, farewell everyone.
 
I'd rather join him and do the killing
room topic changed to Lounge<C++>: Oldspeak not permitted. [c++] [c++11] [c++-faq] [get-out] [no-leaving] [no-limit] [no-love] [no-money] [no-pointers] [no-problems] [no-questions] [no-singletons] [no-tags] [no-thephd] [no-topic]
 
23 mins ago, by doug65536
for example, sin isn't a function unless you restrict the domain to -pi to +pi
wtf is this
 
aw man
I roleblocked the Investigator
 
9:41 PM
@LightnessRacesinOrbit A chat message. Are you new here?
 
and then he got murdered first night.
ok
the tags are getting a bit silly
 
Oh, really?
You killed it.
 
room topic changed to Lounge<C++>: Oldspeak not permitted. [c++] [c++11] [c++-faq] [no-helpdesk]
 
people will pick another room if thephd gets banned :(
 
You monster.
You killed all those poor young tags without breaking a sweat.
 
9:43 PM
hahahaha
I'm the Mass Murderer, not a prostitute
3
fooled you!
we should have a room game of Mafia
let's face it, there'd be nothing better than stabbing the Cat in the back
4
 
what, you don't want to brutally murder the Cat?
 
Not really.
 
man
guess I'll have to keep playing it on Starcraft 2 then
 
9:49 PM
@DeadMG What.
 
He mad
so mad
 
basically, I pwned him so he raged
 
Oh.
Standard issue BM.
 
> And last but certainly not least, and the most extreme example of a world-class, lifeless, moron of a loser, DeadMG*
 
nah, what makes it better is that he was using a hideously overpowered strategy
and I beat him easily anywy
and then he raged like a little girl
 
9:52 PM
He is right that you are fat, though.
 
Although "lifeless" is pushing it.
I mean, you seem quite alive.
Still, it's a weird BM tactic.
 
@DeadMG: " But you can't store them (macro expansions) anywhere.": ideone.com/Rg55tV (stringify is somewhat relevant)
 
comedy gold
 
I mean, usually, when your average gamer gets hit hard by the Dunning–Kruger effect and starts thinking he's the best, only to be crushed by someone who's better than him, he'll whine about the game being unbalanced, or his opponent being a cheater or something.
 
9:54 PM
@EtiennedeMartel, yeah, same phenomenon as "the compiler has a bug"
 
Saying "he sucks because he plays more than me" is weird.
 
"He cheated. He studied..."
 
@rici "He's doing so well he must have cheated"
 
Although, playing 6 hours per day is ridiculous.
 
so's hanging out here. oh, well.
 
9:56 PM
@EtiennedeMartel Eh. J was only like, sixteen then.
 
what?
 
@R.MartinhoFernandes J is pretty close to I on a keyboard.
 
0
Q: Stochastic process compiling to "C"

mojtaba nasiryI am working on Stochastic process, and I have impelemented a mathematica code to simulate Ito process and average over all data. Unfortunately I can't compile my code to "C" to speedup the running time, my code is hear: Clear["Global`*"] endtime=100.; midtime=0.; timeinterval=endtime-midtime;...

Oh dear.
 
9:57 PM
nice. my hash table is faster than std::unordered_map
 
@JohannesSchaub-litb You are using the same hash functions for both, right? :-P
 
@Insilico nono! i'm hashing ints :)
 
Here's another one:
0
Q: Can the OS as well as javascript/HTML5 access localstorage?

Clive WilliamsI would like to read the browser's "localstorage" when the browser is off using the OS ! I want to save client data in localstorage and then switch off the browser and the internet and then let an OS program (a windows exe) access and analyse that data and then write new data into that localstor...

> Obviously all of this has both huge potential POWER and huge potential DANGER !
 
@JohannesSchaub-litb did you get a rough percentage? (at least for one perf test)
 

« first day (841 days earlier)      last day (4109 days later) »