« first day (1597 days earlier)      last day (3577 days later) » 

17:00
@AndyProwl yeah, that's it, in glid
it should be foo& operator = (...), not foo operator = (...)
@LightnessRacesinOrbit Erm. Chill?
@thecoshman All right
@Fanael You found the right timing for that move :)
@thecoshman Alternatively, you could use myMap[theKey] = std::move(theValue); (though this requires that theValue support default construction, which it does in your case, but not all others).
17:01
@JerryCoffin It also overwrites the existing value, if the key is already present (unlike insert/emplace)
@JerryCoffin but ew...
@LightnessRacesinOrbit You know what would be classy? You taking responsibility for the "resultant effect"
4
I read that as the "restaurant effect"
I'd love to see someone take responsibility for that
@AndyProwl Quite true--and you're right that it's not always desired.
any way, time for nachos :D
17:02
Anyone following Cricket World cup here?
you nooble
Also. You clearly need to chill. The irony levels in "You've gotten really bossy lately, @Xeo. Mind your own damn business" are so high, it is hard for anyone to assume you weren't aware of it
@YourFriend Ah you renamed yourself my furry friend :)
"someone else is infringing on my bossyness territory!"
2
@πάνταῥεῖ I didn't
17:04
@LightnessRacesinOrbit Nobody is forcing you to keep engaging with a pirate that gets "on your nerves" saying the same thing about 50 times either. I suggest that you chill, step away from the computer for a while, and think about what it is that you're doing here.
@jalf Worse--"Somebody who actually has a right to be bossy (because he's a room owner) is infringing on my attempt at usurping those rights."
@jalf Yup. "I don't appreciate the competition". I don't like to be told when I misbehave. It's my turf [sic]
@YourFriend Well, you just stole the avatar of a well known member. So don't wonder about the misunderstandings.
> stole
shots fired :)
@πάντα I didn't stole, it was sitting idle in the Pictures folder xD
17:08
Did anyone have a look at 8cc minimalist c++11 phuck C11 compiler yet?
@πάνταῥεῖ both appear to be this one, scaled down to avatar size.
user784668
@sehe Yes.
Damn. That was wishful thinking if ever it existed. How could I have missed the enormously expected obviousness that it was about c11... :(
@sehe Glanced at it enough to see that it was C only, and almost immediately lost interest.
user784668
@sehe Ugly as sin, but that's to be expected, it's in C
17:11
6688    top_dir         ansic=6597,sh=91
2846    test            ansic=2846
153     include         ansic=153
Not too shabby. If that's already feature complete, it has some amount of tests and self hosts. Of course, it's useless since C
@sehe It was fully of pointers to weird static things.
Well. C :) Anyhoops, make fulltest blazes by in 1.7s including compilation of everything. Something about that is refreshing
sehe@desktop:/tmp/8cc$ ./test.sh
All tests passed
A good exercise in understatements
@sehe Obviously it’s not bloated by templates!
Xeo
Xeo
nom nom salad
@FredOverflow say "Aardwolf"
@LucDanton Yeah. That's somehow a bit appealing :/
17:16
Do these operators work in constant time complexity?
user784668
@sehe So an order of magnitude faster than a hello world-equivalent in boost.spirit!
user784668
@Jefffrey linear in N, for obvious reasons
right
Xeo
Xeo
@Fanael Since N is a template parameter, I think you could technically unroll them
Just make a pack out of it, really
user784668
@Xeo Irrelevant, complexity doesn't care about that.
Xeo
Xeo
17:19
and then apply member-wise
right, I guess
user784668
If N grows ten times, the time grows ten times too.
@Jefffrey Probably constant time, for N less than or equal to the size of a machine word.
user784668
Of course, for any specific bitset<N> it's constant time, because N is a constant.
:D
Yeah, it was a dumb question.
17:22
@Fanael Not necessarily. In particular, its speed may easily be identical for all N <= 64.
How does on make sense of the Clang source code? I just spent 30 minutes trying to find the code that parses declarations like int *a[10];...
@райтфолд hahaha the guy is using your preferred style of garbage collection: "Compiler is not a long-running process. ... If we really need to free memory, we could use Boehm garbage collector."
user784668
@JerryCoffin For any N <= some number it's constant, because it's bounded by a constant.
@FredOverflow And you found it? That's awesome quick
@sehe No, I gave up in frustration. Then I ordered Pizza to calm me down.
user784668
17:24
> It will never run out of memory unless you give an unrealistically large source file.
In a well-factored code base, that code should be hard to spot.
@Fanael "Theoretically constant because it's bounded by a constant" isn't really the as "the time is identical". I'm making the latter statement, which is a much stronger one.
user784668
How much is "unrealistycally large"?
@sehe Does it really use plain malloc? Doesn't malloc have the overhead of allowing free everywhere? Why not pre-allocate like 1GB and then bump a pointer?
user784668
Is 2 MB source file unrealistically large?
17:26
whatup chat
> you can write code as if garbage collector were present
@Fanael source file or translation unit?
user784668
@FredOverflow Yes, plain malloc.
user784668
@FredOverflow Source file.
wait point 2 is even funnier
17:27
@Fanael amalgamated source files are routinely that big
user784668
Auto-generated.
> that design decision has eliminated use-after-free bugs entirely
@Fanael That sounds like a wasted opportunity. All those links for nothing.
#define free exit   // no more use-after-free bugs!
user784668
@Pris IKR
user784668
@FredOverflow Because premature optimization.
user784668
17:28
Well now I wonder how much time it spends in malloc.
@YourFriend I do. Just not for C++ GUIs.
@Jefffrey :(
alright
@thecoshman dude that's not an SSCCE. You can remove tons of code and get the same result
You failed to look up the documentation for std::map::insert
Top tip: programming by guessing doesn't work!
you should switch to GPSL. there's no silly documentation to go through.
Say that, Main thread creates thread1 and thread2. 1 - Does it possible "main thread and thread2 simultaneously join thread2"? 2 - Does it possible "thread1 join thread2", in other words can a thread be joined by a thread which is not its parent? — oiyio 53 mins ago
-.-
17:42
@LightnessRacesinOrbit thats what you get for putting in the effort of fancy ascii diagrams
@Pris Yeah :(
Does it possible "accept my damn answer and read the fucking documentation"
@EtiennedeMartel Pfft, doesn't seem that far-fetched to me. Did you read the whole thing?
@LightnessRacesinOrbit I did. It's incredibly stupid to suggest that "gays" are "recruiting" children.
I mean, that's your basic fearmongering right there.
"Dance with me my Princess Boy"
17:46
Hey guys/gals, I've ran into a hitch when it comes to separating templated class declarations and definitions. I've found "explicit instantiation" and I've also read in the accepted answer: stackoverflow.com/questions/1724036/… that .h files aren't actually compiled. It seems "logical" to me that explicit instantiation is compiled and will work faster than implicit one, but can't find a comparison anywhere. Is this the case?
"The Gays are coming for your kids!"
@EtiennedeMartel I don't think that it is.
Surely the LGBT community would very much like it if children were faced with 50% "LGBT" and 50% "straight, 'normal'" whatever the heck you want to call it
There's not necessarily anything even wrong with that
Calling an observation of that "fearmongering" is the incredibly stupid thing
and making children dance around singing "Princess Boy" is also incredibly stupid
Yeah, except the bit is in red and bold and the wording is alarmist.
Take away gender roles if you like but simply reversing them is as bad, if not worse
I mean if you ignore the dramatic language, there appears to be truth in that photo
@LightnessRacesinOrbit Yeah but you can't ignore it.
It's part of the message.
Hence the "fearmongering".
17:50
You ignore it when it's not people you perceive to be "homophobic" or whatever. Dramatic alarmist language is inherent in such 'propaganda' material.
Suddenly when it's these particular people you think that's part of the message
I think that says a lot more about you than about them, frankly
-4
Q: Incorrect answers in a C++ algorithm with math.h functions

TOMILOVMy C++ mathematical algorithm outputs incorrect answers. What's wrong with this code? I'm using Borland's C++ compiler and Windows XP. int main(int argc, char* argv[]) { N = 6; X = new double[N]; Y = new double[N]; Z = new double[N]; T = new double[N]; X[0] = 35600; ...

jesus
@ljetibo measure
"Borland's C++ compiler and Windows XP" panic
I have to admit that my perception of that is probably heavily influenced by the fact that it's not the first time UKIP members do some homophobic bullshit
So I'm probably writing it off as "more of the same".
user784668
What's UKIP?
@Fanael A far-right UK political party.
user784668
17:52
> UK Independence Party
user784668
UK is already independent you knobheads.
@Fanael They mean independent from EU.
@Fanael No it's not
@EtiennedeMartel Yes I believe that is in play
@LightnessRacesinOrbit Oï.
Hey, did you know, members of other political parties are homophobic too!
17:53
@LightnessRacesinOrbit Yeah, but in UKIP's case they're making it obvious.
user784668
I'm moronphobic
user1804599
What can be formally specified for functions other than preconditions, postconditions and thrown exceptions?
user784668
@LightnessRacesinOrbit is triggering me
@LightnessRacesinOrbit if you scroll down far enough, there are tons of gotos :D
UKIP are, by their very nature, more outspoken. They have no power. They are not a mainstream party. The mainstream parties have to talk only in guarded political messages.
It has nothing at all to do with what the message is: UKIP can be brazen about their beliefs.
user1804599
17:54
I consider parameter and return types to be preconditions and postconditions.
@райтфолд effects
@Blob I did goto closebutton; almost immediately
user1804599
Hmm, interesting.
user1804599
In Spec# you can specify which non-local variables a function is allowed to mutate.
user1804599
If it mutates any others you'll get an error.
17:55
o.O
I bet it uses backspace indentation too
user784668
@райтфолд That sounds useful.
@райтфолд by non-local do you mean parameters?
user1804599
No, parameters are local.
user1804599
I mean fields and globals.
BTW no offence but this code is truly horrendous. Awful variable names, no comments, massive functions, gotos, no spacing/indentation, ... I would literally fire an employee for submitting code like this. — Lightness Races in Orbit 19 secs ago
17:56
I used to add const to my parameters passed in by value sometimes
user1804599
public void Disturb(Rectangle r)
modifies r.*; // modifying anything but fields of r results in an error
{
    X = r.Y; r.X = Y;
    Dx = min{Dx, r.Dx};
    r.Dy = max{X, Dy + r.Dy, 100};
}
@LightnessRacesinOrbit Comments like that don't really help someone get better... the question was put on hold, why keep beating on the person? For all you know this is some 12 year old trying to learn C
@FredOverflow Yeh, I'm kind of not that great with C++, that's why I'm practicing. I was looking for a quick answer. Seems I better just test it ...
@Pris And now he knows what not to do.
@Pris Do you expect him to magically divine the problems?
user784668
@Pris Welcome to SO.
17:58
@Pris He also knows now just how serious those issues are.
Honestly, I don't do it just to be mean. There is honest value in there. Whether you can see it or not.
@LightnessRacesinOrbit I expect him to read the reason the question was put on hold and redo the question with a minimal example.
4
user1804599
Such postconditions are not very interesting by themselves, but they are when you want to extract documentation from code (à la Javadoc/Doxygen) or when you want to override methods (they respect LSP).
@LightnessRacesinOrbit look at the original tags: C++, C, Assembly, Fortran, Pascal
@Pris Hahahahaha
@Pris Would you like fries with that?
@Pris That never happens.
@ljetibo It’s unlikely to make a difference in my experience.
user1804599
17:59
@FredOverflow difficult, though.
user1804599
Even when all checks are performed at runtime and not at compile-time.
A big one, that is.
user1804599
Well perhaps not that difficult.
@ljetibo .h files are compiled. Not as units, but their contents absolutely are compiled. The same paragraph you quote goes on to make that clear, if only you'd read it!
user1804599
In Clojure you can specify that your function does I/O, and if that function is called in a transaction it will throw an exception.
18:00
@Blob Must be a troll then. faith in humanity restored. (oddly)
user1804599
But there's no enforcement that you must annotate your functions that way.
My external hard drive keeps spinning down then has to spin up again for the next song. It's very annoying.
Probably not good for it, either
It astounds me that no one's created a port of qwt to qml
user784668
@LightnessRacesinOrbit Aye, disable spinning down.
user1804599
Although that's mostly culture.
18:02
@LightnessRacesinOrbit You don't have an external SSD?
@πάνταῥεῖ I have an internal SSD with my OS partition on it, but my externals are old-fashioned. n TB is just too expensive SSD.
Also LaCie didn't make a fit looking one, last I checked
I could use a new one though hmm
no dont do it me you're broke
ok
If you need Tera-Bytes of course :)
I've got a 60GB SSD with a pretty huge music repository.
@Fanael I keep doing so. It keeps happening.
@Fanael I think it's a bug in the driver
/me upgrades LaCie Desktop Manager
> This post is not too short. This post is not too short. This post is not too short. This post is not too short. This post is not too short. This post is not too short. This post is not too short. This post is not too short. This post is not too short. This post is not too short. This post is not too short. This post is not too short.
also this
user784668
@LightnessRacesinOrbit l'Cie?
18:05
@Fanael LaCiE
@LightnessRacesinOrbit If you mean: "The preprocessed code is then clubbed with the cpp file which is actually compiled." I took "clubbed with cpp file" as the cpp file which has the definitions. It's not as descriptive as you say. If you, like me, don't know as much about compilation as you need to to understand this it doesn't make the same sense.
user1804599
@sehe :)
user1804599
@sehe in PHP cycles result in memory leaks, but nobody cares since PHP programs are invoked per request and very short-lived. :P
dabs.com/products/… <-- about the price of a non-SSD with 30x the capacity
so... if I define foo(T&& t) that means that the 'T' a user passes will be 'moved' into my function right... giving over ownership to 'foo'... yes?
18:08
@thecoshman no
user1804599
Please give the whole definition.
crap damn it
user1804599
foo(T&& t) is not a definition.
user1804599
It's not even a signature.
@thecoshman You get a reference. The constructor is supposed to perform the actual moving (or as I like to call it, the pilfering).
18:08
All it means is that you are guaranteed to receive an rvalue.
user1804599
If you always want to take ownership, say foo(T t).
Similarly a copy constructor receives a reference and is supposed to perform copying. The copy constructor does not receive a copy.
@thecoshman Oh, that’s not a constructor right?
oh, well I want to basically do a 'textureStore' that I can 'move' textures into... the idea being you access them through this 'store'
@thecoshman Your foo will receive a reference to an rvalue. You'll typically do this when you want it to move the value from there to some destination, but it's not required.
@LucDanton bingo
18:10
I like by-val for sink arguments.
user1804599
SSCCE.
@thecoshman Texture Shack :)
@райтфолд oh yeah... I guess that is what I want to do
user1804599
I almost always take by value unless I want to take by non-const lvalue reference.
I think I'm thinking in Rust...
18:11
@thecoshman It means the client will have to provide an rvalue (if it has an lvalue, this means doing move(...) on it). Whether the argument will eventually be moved from depends on what foo() does. Just writing move(x) does not make x moved-from - it only converts it to an rvalue
because even if it was defined foo(T t) some one can still do foo(t); t.lol
user1804599
@thecoshman that will copy in C++.
user1804599
In Rust that's illegal since it'll move and you can't use moved-from objects in Rust.
Rust is were we bound all in the end.
No wait, that was _dust_ actually :-P ...
Yeah, C++ checks use-after-move dynamically. Where 'check' means 'UB' most of the time.
18:12
@AndyProwl which is what I want...
@πάνταῥεῖ Rust in the Wind
I was able to add another troll to the scene and nothing broke
success
user784668
Rust moves by default?
user1804599
eheheh my AWK answer to Python question has a positive score.
@thecoshman OK. I was just explaining what's going on
user1804599
18:13
@Fanael yeah
@Fanael Yes.
Oops-driven programming
@FredOverflow is that like 'Shield Swimmer'
when you click run and look away hoping nothing goes wrong
and when it does you're like "oops"
I simply cannot comprehend why your country's educational institutions teach "C++" using an IDE for DOS that predates C++ itself by six years. I just.... I don't get it. At all. — Lightness Races in Orbit 17 secs ago
user1804599
18:13
@AnitGhosal neither are you. — райтфолд 5 secs ago
@AndyProwl well then... look like I might be understand shit :\ RUN!!!
is proper full of shit today
@райтфолд I find Rust parameter syntax confusing.
user1804599
help vampire troll
@thecoshman thumbs up
user1804599
18:14
@FredOverflow I don't really care about Rust, since I don't really care about object lifetimes.
@LightnessRacesinOrbit it creates fond memories
@AlexM. Would be interesting how this applies for actual beliefs/religions in a list :-D
struct textureStore{
    void store(const std::string& name, gldr::Texture2d&& texture){
        textures.insert(std::make_pair(name, texture));
    }
    std::map<std::string, gldr::Texture2d> textures;
};
sound enough?
@FredOverflow Same syntax as with any variable definition though.
I remember my first day in high school
powering up a pentium 2
and writing hello world in borland pascal
18:15
@thecoshman That make_pair call is attempting a copy.
theory is, if you give this 'textureStore' a texture, you will never try to access it directly,
@thecoshman you need std::move again inside
user1804599
The only reason you'd want to care about lifetime is when destruction has side-effects.
@LucDanton ah, so std::move, but close enough right
user1804599
Which it doesn't in a functional language, so use a functional language and woopwoop.
18:15
@thecoshman cos texture is an lvalue
otherwise looks okay
@thecoshman In that case by-rvalue-ref and by-val achieve the same thing. So pick your poison.
@AlexM. Borland Pascal was awesome!
don't you want to provide an overload of store that accepts by const ref and does a copy?
oh, textures aren't copyable in your code, right
@FredOverflow ikr
I didn't like it when we were moved to the newer lab
where we used Dev Pascal under Vista
@LucDanton o_0 I think I understand...
user1804599
18:16
I want to implement AWK in LiveScript.
user784668
So how do I copy in Rust?
@thecoshman Yep. If a function takes whatevs&& then I never use any variable that I pass to it.
there's something about those DOS Borlands
user1804599
in the CPU architecture labs we used Turbo Assembler or sth
I liked that one the most
18:17
@AlexM. How I hated, when we've got that new punch card typing machine. It had an english keyboard.
because it was blue and ran in dosbox
@LucDanton never do, or never can?
Never do.
If a function allows it, it would be a a curious API design.
user1804599
I thought of having a Try ADT with Success and Failure alternatives, and making try without a catch clause return a Try object.
user784668
@LucDanton This should be enforced by the type system.
18:20
In truth there is a bit more to it if you consider 'partial' moves. E.g. sometimes you move out std::move(a).x and then right after std::move(a).y, which is fine. Happens a lot with tuples.
^the Rust compiler handles these fine btw
user1804599
let x = try { foo(); };
io.writeln(type(x)); // Success[Double] or Failure[Exception]
let y = try { foo(); } catch { case _ => 42 };
io.writeln(type(y)); // Double or Int
Not so for arrays though.
> Valve's VR headset is named Vive, and HTC are making it pcgamer.com/…
inb4 half life 3 is the launch game
I love it when Hans Böhm talks about C++ zräds.
@Fanael Yes, C++ does need that we bolt on more features! First a linear/affine type system, then we can get right to dependent types!
18:21
@AlexM. probably hl3 or l4d3
user784668
@LucDanton Yes.
user1804599
Type constructors can just be memoised functions that return types!
@райтфолд Why memoised?
Is Bjarne a superset of James?
user1804599
18:23
So that Array(Int) and Array(Int) return the same object.
user1804599
@FredOverflow one of its base classes.
I see
ok I have to admit. that's pretty.
@FredOverflow I don't like these new thumbnail captions
user784668
@LucDanton Frankly, I don't think C++ would be any more shit if it got dependent typing.
@райтфолд Doesn't work if you want to modify them
user1804599
18:27
Types are immutable.
Apply attributes or whatever
@Fanael But but but boxing!
@LightnessRacesinOrbit heard some absurd stuff about the pricing
being more expensive than the most expensive iPhone
user1804599
@FredOverflow You can read that video title as "Ruby is just as good at not being able to scale as Java." :)
18:30
Phones are too big
user1804599
@CatPlusPlus have you ever used Google Closure?
user784668
@LucDanton Manny Pacquiao
< 4 inches for the win (screen size)
James-news: Java is web-scale
user1804599
18:30
OK.
user1804599
I think I can make my compiler emit code that the Closure optimiser understands.
user1804599
ClojureScript does that as well.
What's Closure?
@Fanael On a related note (not that kind of boxing), I have no idea how to figure out what is meant by 'erasure' in the context of DT implementations.
rubby is shit and JVM is a much better platform
@Jefffrey JS optimiser/packer thing
user1804599
18:31
@Jefffrey It's a set of JavaScript manipulation tools. I am interested in the optimiser in particular.
user1804599
// it optimises this
function hello(name) {
  alert('Hello, ' + name);
}
hello('New user');
// to this
alert('Hello, New user');
user1804599
for example
user1804599
You can tell it about data types using special comments but I want my compiler to generate those.
@LightnessRacesinOrbit I've gotten used to it quite quickly.
user784668
@LucDanton Me neither
18:37
in C++ the code int array[4] = { randomNumber(), randomNumber(), randomNumber(), randomNumber() }; creates an array with one element which is random and not 4 elements like I asked for. What's the matter?
no
int randomNumber() { return 4; }
@FredOverflow it's ugly as fuck
does the line resolve when randomNumber() is executed once or something?
18:40
LOOL OMG...TY Lightness!! — itsid 36 secs ago
mesa so helpfula
@hb20007 What is the definition of randomNumber()
@milleniumbug return (rand() % 9 + 1);
@райтфолд Only two more weeks to Scala Days!
I have camembert
yum
user1804599
> Your code compiled to down to 0 bytes. Perhaps you should export some functions?
user1804599
18:42
@FredOverflow omg odersky
@hb20007 The matter is you're lying
@milleniumbug ideone has an absurd amount of ads
milleniumbug: WOW ur code is very similar to mine so why doesn't mine work?
@райтфолд Also Heather Miller!
18:46
@hb20007 How the hell are we supposed to know?!?!
user1804599
Who is Heather Miller?
@Pris What ads?
user1804599
I only know Kazuhira Miller.
I use AdBlock.
@milleniumbug "Ideone is powered by Sphere Engine™" at the bottom
user1804599
18:47
And some wannabe cowboy from my village who calls himself Jim Miller.
Lightness: I'm talking to milleniumbug
@hb20007 Undefined behaviour
@hb20007 As long as you are here, you are talking to all of us.
user784668
You dick.
Why do people come into the chatroom and totally ignore the fact that everybody else uses "@" for notifications? I don't get that.
18:48
you can talk to me but I ain't listening
nanananana
user3010322
@Rapptz I did it:
user3010322
fuck off gif
It's Robot's favourite gif.
Puppy don't flag you hypocrite.
-7
A: Where is the standard library?

enamresuIn C, the 'standard libary' is the standard input-ouput library, called 'stdio'. In C++, it is called 'iostream'. By adding this line to the begining of a program, the library will be loaded when the program is executed: #include <iostream> I believe that any C based operating system, such as ...

user1804599
woot constant folding shiny
ahahahahahahahaha
> In C, the 'standard libary' is the standard input-ouput library, called 'stdio'. In C++, it is called 'iostream'. I believe that any C based operating system, such as linux, includes this file by default.
3
just beautiful
@ThePhD o.o what did you do and why is that window green?
user3010322
@Borgleader sol now compiles with Visual C++
user3010322
18:52
We lost support for VC++ a while back because it couldn't handle DA TEMPLATEZ.
user3010322
I did some major refactoring of pieces and managed to get it to work.
user1804599
user1804599
Should sqrt(-1) return i or throw an exception?
user784668
@райтфолд i
user1804599
18:55
I think so too.
user1804599
However.
user784668
Should 2 + 2 return 4 or throw an exception?
user1804599
Then I also want arbitrary hypercomplex numbers.
depends on what the return type is.

« first day (1597 days earlier)      last day (3577 days later) »