« first day (370 days earlier)      last day (4563 days later) » 

8:00 AM
OMG WTF is an MPL lambda expression?
 
hi
 
I r 21 today!
 
@RMartinhoFernandes an unnamed metaprogramming function, I'd assume?
 
@DeadMG Happy birthday!
 
I just read Vertex as Vector. Derp.
 
8:01 AM
@RMartinhoFernandes Generalized metafunction.
 
@DeadMG Happy cakeday.
 
Fusion's find_if takes one of those things.
 
Right, and it will be applied to types in the sequence.
 
I've been meaning to look into MPL, but I'm too scared.
 
Yeah, not what I need. I guess I'll have to use good ole fold.
 
8:05 AM
also in the python binding code
 
Boost.Python has sucky documentation.
 
i think boost should be split in smaller parts. it is too large. it is far too large.
 
But you asked to build all its libraries.
 
It's not a monolithic library, it's a collection of libraries.
How much smaller do you want it to get?
 
I guess it depends on your point of view. It's easy enough to use a single library, like, say, Boost.Thread in isolation, but they're still distributed and build as a single multi-gigabyte blob
 
8:15 AM
You can build boost.thread on its own.
 
@CatPlusPlus there is a tool for generating subsets, but it's solving the problem of complexity by introducing more of it. not to my liking. a smallest subset would just have the stuff that one really needs, mostly the stuff that's now in the standard library (smart pointers, fixed sized types, function and bind), plus workarounds for the various compiler idiosyncracies.
 
You also don't need to build all possible variations.
 
@RMartinhoFernandes yes and no. By downloading all of boost, and using the build system for all of boost, and simply configuring it to build specific libraries only
 
ok, big problem
 
runtime-link=static is pretty much useless, as is threading=single.
 
8:16 AM
my CPU is idling at 100 degrees C
 
Cool it down with fire.
 
amazing it's still operating, actually
 
@CatPlusPlus The former is very useful if your own code uses static linking
 
What are you waiting for?
Shut it the fuck down.
 
the CPU has a temperature kick-in for when it gets too hot
 
8:17 AM
it should not be over 76 degrees Celsius, IIRC
 
which a lot of people do because Microsoft likes to play hide and seek with dll dependencies, so you avoid a lot of pain by statically linking things
@DeadMG clean the fan, silly :)
 
My desktop GPU operates on ~80 on average.
 
yeah, I'm going to
just after I finish checking my bank account
 
The temperature tolerance depends on the CPU.
 
it probably doesn't help that .NET 4 is taking up, oh, a whole core
 
8:18 AM
@CatPlusPlus gpus are generally designed to survive higher temps
 
and restarts itself when I terminate the process
 
Stop the service.
@jalf I had nothing but trouble with static CRT. :P
 
@DeadMG how exactly is the CPU "idling" then?
 
one logical core out of eight isn't much
 
@CatPlusPlus Oh? In my experience it Just Works(tm)
hit compile, and you have a working app that you can redistribute
 
8:20 AM
At least on Windows. I did have to link libgcc and libstdc++ statically on Linux, because it's pain in the ass to get a build working across distributions otherwise.
 
the CPU fan is working fine
 
@DeadMG but it's hardly idling either ;)
 
one core out of eight is hardly at load
 
air pockets between cpu and heatsink then? Insufficient case ventilation?
 
could be case ventilation
a fan just failed yesterday and the temps are dropping like a rock now that the side of the case is open
but why on earth would the CPU rocket up to 100 degrees in thirty seconds this morning, and be fine for hours of solid load playing BFBC2 last night?:
 
8:27 AM
I don't remember having a desktop PC with a closed case.
 
You can embed the DLL as a array literal in the source code. You can have the application dump the the DLL files in the current directory by creating a global variable that performs this in its constructor.
 
It's always a mess of cables and dust sticking out from one side.
 
it's illegal to redistribute the CRT DLLs for Windows
 
Awesome #include <boost/fusion/include/all.hpp> does not include all of boost.fusion.
 
@StackedCrooked Or, you know, just have DLLs in the application directory.
 
8:28 AM
@StackedCrooked ಠ_ಠ
 
@CatPlusPlus I like self-contained executables :)
 
You might not have the rights to write to application directory.
 
@CatPlusPlus Right. But there are solutions to that problem.
 
@DeadMG Everyone's doing it, anyway. I doubt Microsoft really cares.
 
true true
what does the CRT even really do?
 
8:29 AM
Stuff.
 
it seems to me like most of the useful code is buried away in the templates of the Standard containers
and maybe in the iostreams
but I don't get what it is the CRT actually does at startup
 
Implements C standard library, and runtime support code.
 
initializes static variables, for example
plus implements most of the C standard lib
 
oh yeah, and that
 
including malloc and friends
 
8:30 AM
yeah, but I don't get how that requires such a monolith
 
bunch of exception handling stuff too, afaik
 
If you've got Visual Studio Pro, you've got CRT sources.
 
there's been a few vids on channel9 about the crt recently
might want to watch those :)
 
Startup code is in crt0.c
 
could do, actually
I stopped watching Channel9 vids recently
 
8:31 AM
@DeadMG Huh?
 
the Advanced STL stuff was pretty basic and the CRT stuff was just boring
@StackedCrooked No, really. You can only ship Microsoft's redist. You can't redist them yourself.
 
It parses command-line into argc/argv.
Initialises default heap.
Multithreading stuff.
Runtime checks.
@StackedCrooked Like what?
You usually don't have a control over where user installs the app, and if your app requires admin rights to run from Program Files, you're doing it wrong.
 
just memory map it
 
@DeadMG Can the OS use that as a library though?
 
You'd have to implement the DLL loader yourself, from scratch. Or delve into undocumented NT APIs.
The only official API function to load DLLs is LoadLibrary(Ex), and those load from on-disk files only.
 
8:36 AM
actually, that's not entirely true
it's a known fact that HMODULE is a pointer to the start of the PE header
you could just reinterpret_cast it
and then pass to GetProcAddress
 
Loading DLL is not just memory mapping it.
 
0
A: How Are C Arrays Represented In Memory?

Anonrandomint x[] produces the same result as int* x; it's just a pointer therefore notations x[i] and *(x + i) produce the same result.

"arrays are pointers" alert ;)
 
true, I hope the DLL doesn't have an important DLLMain
 
And doesn't need to be rebased.
 
and that
which it almost certainly does
 
8:38 AM
be carefull references and pointers are not the same. reference has to be initialized
 
HMODULE being a pointer to header is also an implementation detail, so it's not covered by the API contract.
 
@user800454 no shizzle?
 
@FredOverflow
 
@CatPlusPlus Actually, I believe that it is a strict fact.
Microsoft have been documenting it for some time
 
I believe the mantra is "all handles are opaque, don't rely on their implementation".
 
8:39 AM
@user800454 Usually, we say something after "@UserName". If you say nothing after it, the equivalent C code would be *p; or something like that ;)
 
that was fine, until they started shipping __IMAGE_BASE* base; HINSTANCE MyHinstance = (HINSTANCE)base; as a way to get your own HINSTANCE from the linker
 
HMODULE arguments are documented as "A handle to the DLL module that contains the function or variable. The LoadLibrary, LoadLibraryEx, or GetModuleHandle function returns this handle." or similar.
 
not a good way to think, you are down the wrong path
 
Eh? GetModuleHandle(nullptr) returns a handle to the own instance.
 
I think it does now
but Microsoft have certainly both advised and used the above approach in the past
 
8:41 AM
At least since Windows 2000.
 
that is, get the base of the image from the linker, and simply cast to hinstance
strictly speaking, the above technique produces an HINSTANCE and not an HMODULE
 
pointers are evil only use them when needed
 
You're preaching to the choir here, you know.
Or whatever that expression was.
 
I believe that it is preaching to the choir
or maybe preaching to the congregation
 
I don't think I've ever heard the congregation version.
 
8:44 AM
References are pointers, but non-const references are non-const pointers and const references are const pointers
 
We're a congregation?
 
What use is it to preach to a choir though? Wouldn't their singing muffle the preaching?
3
 
I think that's the point.
 
@user800454 References are not pointers.
 
@CatPlusPlus I thought 'preaching to the choir' had the meaning of 'preaching to the converted' or some such.
 
8:45 AM
con·gre·ga·tion (knggr-gshn)
n.
1. The act of assembling.
2. A body of assembled people or things; a gathering.
 
yes
actually, congregation is usually saved to refer to Christian gatherings in a church
 
And two more about religious stuff.
 
the purpose of the phrase being telling people what they already believe
 
So clearly my little joke about the singing is still funny.
 
3.
a. A group of people gathered for religious worship.
b. The members of a specific religious group who regularly worship at a church or synagogue.
4. Roman Catholic Church
a. A religious institute in which only simple vows, not solemn vows, are taken.
b. A division of the Curia.
See, I knew it'd be formatted wrong.
 
8:47 AM
@CatPlusPlus Ah, so a congregator is an assembler!
@RMartinhoFernandes Here is another evidence that references are not pointers: there is no such thing as an rvalue pointer, but there is an rvalue reference :)
 
not even remotely :)
 
@FredOverflow That doesn't disprove the claim that pointers are like lvalue references though.
 
Maybe you can convince Bjarne to introduce rvalue pointers into C++1y with **int syntax? ;)
 
8:50 AM
WTF would an "rvalue pointer" be useful for?
 
**int i = &42;
 
References are usually taught after pointers, for some reason, and often explained as "pointers that cannot be NULL".
 
@LucDanton I don't need to disprove it, the standard makes no claim that a reference is even remotely connected to a pointer.
 
@FredOverflow By that same token you don't need to disprove that reference are like pointers.
 
8:52 AM
@CatPlusPlus For what it's worth, we teach references halfway through the semester and pointers at the very end :)
@LucDanton Right. I don't. Onto the next topic!
 
And what is the next topic?
 
@CatPlusPlus and doesn't use TLS
 
@CatPlusPlus Write to temp folder and load it from there. (Might require setting a env variable at runtime.)
 
@RMartinhoFernandes Should C++1y support void function_template_disguised_as_ordinary_function(auto x, auto y); syntax for "implicit templates"?
 
8:56 AM
Also, can I say C++1y, or would that be too optimistic? :)
 
I'd like void forwarding_template_function_disguised_as_ordinary_function(fwd T x, fwd U y).
 
@StackedCrooked Then you have to transform every single one of library functions into function pointers, and then load them manually.
 
@RMartinhoFernandes void foo(auto&&);
 
How would that be useful? Implicit std::forward calls inside the body?
 
Wrong kind of forwarding?
 
8:57 AM
Screw your silly implicit stuff, I WANT MODULES.
5
 
@FredOverflow No need to create more template params. But auto&& like Luc proposed seems good enough.
 
Yeah, it does. Anyone willing to propose it? :)
 
I also like void function_with_lazily_evaluated_params(lazy T x)
 
Hello Scala!
I want Monads in C++1y ;) We already have >>= and return and do in C++, simply give them another meaning :)
 
So I can call function_with_lazily_evaluated_params(highly_expensive_computation()) and not do the highly expensive thing if not needed.
 
8:59 AM
You mean Mo*dules*.
Bah, who am I kidding, they'll never do that, that'd be too good.
 
@FredOverflow You mean something like do-notation?
Cause you can make monads right now.
 
@RMartinhoFernandes Well, you can pass a lambda.
 
@CatPlusPlus That's what I'm doing now.
But it's not as cool.
 
@RMartinhoFernandes You can pass a user-defined object that has a lazy implicit conversion to the thing you need.
 
@FredOverflow But that requires too much boilerplate.
I'd like to see multiple dispatch too.
 
9:02 AM
@CatPlusPlus Is there a way to make modules interesting without specifying an ABI?
 
Hm, Bjarne is more open to library extensions than to language extensions. How about a purely functional STL? You know, list.sorted() returns a new, ordered list and does not modify the original.
 
I wouldn't mind an ABI.
 
There was a proposal for C++0x, but didn't make it.
@FredOverflow Why?
Just go write Template-Haskell.
 
I guess we can specify a Standard way of doing what every plugin/module architecture is doing each in their own way.
 
But modules can be purely compilation-time, I think.
 
9:03 AM
@RMartinhoFernandes Because immutable data structures are great for parallelism and stuff?
 
I just want headers to be gone.
3
At least in the current state.
 
Well, how would templates work?
 
state<modules> current = sucks;
 
@FredOverflow But without lots of compiler shenanigans, they're horribly inefficient.
@LucDanton export...
 
@RMartinhoFernandes We have rvalue references now. That alone would make many use cases a lot more efficient.
 
9:05 AM
@FredOverflow Consider the current complexity of C++.
 
Compile them to some kind of template IR, and then use that? Dunno, was never insane enough to attempt doing C++ compiler.
 
@RMartinhoFernandes I guess. All in all implementations are more to 'blame' than the Standard, no?
Still waiting on that gcc-server experiment...
 
WTF is that?
 
@RMartinhoFernandes C++ has always been way too complex, even 20 years ago, right? ;)
 
9:06 AM
As for the ABI, if we could only make MS support Itanium one.
 
@RMartinhoFernandes Some kind of magical grail that packs distcc and ccache in one I think.
 
@RMartinhoFernandes So what harm is one additional feature going to do? ;) kidding
 
Do you think you can do all the kinds of optimizations you can do in languages designed with purity in mind?
 
You're probably right. A man can dream, though!
 
Like I said, write yourself some Template-Haskell.
You get the immutables, and the templates (and way cooler).
That should scratch your itches.
 
9:08 AM
Haskell templates are more like a smart preprocessor, aren't they?
Oh wait, what are C++ templates... :)
 
Haskell templates have quasi-quotations and splices!
And you can manipulate ASTs directly!
 
And have fun when it doesn't typecheck.
 
@FredOverflow You mean, the endless copying making them horrendously inefficient?
 
@DeadMG no, the not having to copy them for a lot of things
 
@DeadMG You do as little copying as possible thanks to structural sharing. For example, in Clojure, creating a Vector with one differing element requires only O(log n) instead of O(n). You don't copy the whole thing, only the differing branch.
 
9:12 AM
Always remember to be lazy to be a good programmer.
Also, I'm slacking right now.
 
the roslyn thing at Microsoft uses immutable data structures for that reason. Allows them to cheaply add to their AST without modifying the bits that others might be reading
 
but in sorting a list, you won't be changing one or two nodes, you'd be changing every node
 
@DeadMG You basically create a new list from scratch. But yeah, it's probably 2x or 3x as slow, but you still retain the original list!
 
You can have mutable arrays if you need them.
 
I don't think anyone ever claimed that immutable data structures are more efficient at every task
 
9:15 AM
@RMartinhoFernandes Right, but that doesn't get you into heaven.
 
but it's not as simple as calling them horrendously inefficient either
there are a lot of things that can be done very efficiently by using immutable data structures
 
what I find a pity is that some languages offer some, and some languages offer another
it's a library choice :(
 
@LucDanton Me too!
 
@CatPlusPlus That's one virtue out of three!
 
9:23 AM
What are the other two?
 
Larry Wall (born September 27, 1954) is a programmer and author, most widely known for his creation of the Perl programming language in 1987. Education Wall earned his bachelor's degree from Seattle Pacific University in 1976. While in graduate school at UC Berkeley, Wall and his wife were studying linguistics with the intention afterwards of finding an unwritten language, perhaps in Africa, and creating a writing system for it. They would then use this new writing system to translate various texts into the language, among them the Bible. Due to health reasons these plans were cancelle...
 
@RMartinhoFernandes loafing and procrastinating
 
This question: stackoverflow.com/questions/7847248/
 
3
Q: multi threaded use of user defined objects

KlausI am in doubt with using objects from multiple threads. First of all it is no problem to protect the object against simultaneous access with std::lock_guard or others. The next step is to declare the objects with volatile. class A { public: int val; }; volatile A a; But doing this ends u...

 
just made me realize that there is no faq for volatile and thead-safety yet.
 
9:26 AM
Oh that crazy dude.
 
So, maybe we should add this question to the faq:
27
Q: Why is volatile not considered useful in multithreaded C or C++ programming?

Michael EAs demonstrated in this answer I recently posted, I seem to be confused about the utility (or lack thereof) of volatile in multi-threaded programming contexts. My understanding is this: any time a variable may be changed outside the flow of control of a piece of code accessing it, that variable ...

 
> Being serious for a moment, "thread safe" is not a useful phrase. I recommend banning it from your vocabulary. source
 
@Fred: I don't like sources that are videos. Don't you have something I can read?
 
@BjörnPollex The quote is taken from the comments below the video, just search for "serious".
 
'Basic thread-safety' is a useful concept though.
 
9:34 AM
hmm yeah, always bugs me how people talk about "thread safety" as some kind of universal thing that's completely independent of context
As if it's a binary thing, either an object is "thread-safe" and thus is safe *no matter how many threads you have and no matter what they do to the object" or it is not.
usually the only relevant form of thread safety is "this object is safe if you use it in these specific ways, and if you don't, it's your own damn fault if it blows up"
 
What if it doesn't blow up?
:P
 
It's not entirely surprising that people keep asking the question 'will this not blow up on my face and magically perform well?'. Still naive though.
 
@RMartinhoFernandes still your own damn fault ;)
 
Multi-threading sucks.
 
@LucDanton - I wouldn't have assumed "good performance" to be even remotely related to thread safety. If someone said thread safety I would assume it meant "reentrant with no race conditions" and not much more
 
9:45 AM
@awoodland The bit about good performance is actually often implied. I.e. even on those times you can answer 'yes, it's safe' you can expect the OP to come back and ask 'I multithreaded my code and it's performing worse; why?'.
Maybe not 'implied' but 'assumed'.
 
"Because you suck."
 
"electrical safety" doesn't imply it's an efficient appliance and not wasting a ton of energy in the process though
I think "thread safety" is useful terminology if you used something along those lines
 
Note that I said as much.
18 mins ago, by Luc Danton
'Basic thread-safety' is a useful concept though.
 
3
Q: Confusion understanding Virtual function call and dependent base class

Mr.AnubisI am reading from ebook Templates complete guide and question which i'm gonna ask might be stupid to you but.. There is section in that 9.4.2 Dependent Base Classes which i am unable to understand. Here is the partial text from it: http://tinypaste.com/633f0 // Variation 2: template<typen...

 
man
I feel kind of grumpy
 
9:56 AM
is that the raymond chen commenting on it?!
 
it's my 21st, and my siblings received quite a large sum of money, and my parents implied that I would get the same, but actually it was quite a bit less
am I just being selfish here?
 
@AlfPSteinbach i can build a 3k hello world just fine. though it means ditching the C runtimes. :P
 
@DeadMG - hard to say. It might be that it's not possible for them to give you the same, or they might simply have forgotten what the amount in question was.
 
@awoodland Yes.
 

« first day (370 days earlier)      last day (4563 days later) »