« first day (1607 days earlier)      last day (3341 days later) » 

11:00 PM
Can we get some undelete votes there? stackoverflow.com/q/28980359/85371
 
@sehe Nope. The best thing we can do for anybody trying to use XCode is to help them realize as quickly as possible that it'll never work even close to correctly at all. Helping fix this particular problem just deceives them into wasting more time on a hopeless task. (Oh, all right, I actually did, but still couldn't resist a chance to poke at XCode).
 
PokeDexCode
@JerryCoffin The irony is, I think I voted-to-close the original, all of a sudden
 
@sehe Hard to say--OP closed, in which case I don't think any other close votes show up.
 
Huh. Why do you think voting exists? Surely it isn't so that people can just recreate the question. For the record, I didn't downvote the question. I just edited the useless ranty bits out, as you remember. It was a still a poor question (if you can't figure out your include paths, how can we?). I voted-to-close for that reason. This question is no better, and I did downvote this for the reason I mentioned: it looks pretty bad you try to artificially generate interest for your question. Again, bounties are for that — sehe 10 secs ago
@JerryCoffin I v-t-c yesterday, I think. There is one close-vote still registered :) Can't tell by whom, obviously, now
 
@Griwes We can patch quantum tunneling!
 
11:12 PM
@MartinJames But can we do patches via quantum tunneling?
 
How many undel votes make it happen, again. I never recall
 
You write patches on your machine, and quantum tunneling transfers them to my machine instantaneously.
 
I know one of these take more than I expect
 
Is there a pattern or idiom where I can expose a class interface with a header, but then have the implementation selected at compile-time? Using a fixed header doesn't allow you to vary the implementation if it needs to add class members and so on. I'm thinking of adding an 'Impl' class and letting that be the thing that can be modified instead of the fixed interface.
 
@sehe I don't remember for sure either--around 3 or 5, but I'm not sure.
 
11:14 PM
o.O That many. I thought 3. But indeed some of the time I get surprised
@Pris pimpl indeed. Instantiate the "impl" part in the cpp, makes it possible to select a different impl at compiletime. Link time, even
 
@Pris Almost all use of ABC's does that. Pimpl isn't really particularly relevant. It's mostly about minimizing compile times.
 
@JerryCoffin ABC? Abstract Base Class?
 
Reddit's down.
At least for me.
 
That's great news
 
If it's decided at compile time, you can use something like a strategy pattern instead, with the implementation part passed as a template parameter (and the template providing the interface).
 
11:16 PM
It is
 
I never really 'got' why pimpl would would handy in code but I guess I can see why its useful now that I naturally stumbled upon the need
 
@Pris Yes (but keep reading--not post clarifies that it may not be relevant to your situation).
 
@Griwes Could that be used to escape a guest OS as well?
 
Been a while since I posted an answer on SO.
 
11:18 PM
@Pris I don't think you've quite stumbled on it yet. Pimpl is mostly used (as noted above) to minimize compile time by making the separation between interface and implementation apparent to the compiler, so you don't re-compile code that depends on interface every time you modify the implementation.
 
@sehe Why :(
 
@Nooble Obviously he considers Reddit bad (a position against which I'd have difficultly arguing).
 
Reddit is great.
 
And mohammed is its profit
 
Sounds horrible.
 
11:22 PM
@JerryCoffin My need is only compile time selection of an implementation. I don't want to use templates or inheritance because I don't want the user to be able to select the implementation. My specific scenario: I have an Application class, and a Platform class. The former calls into the latter. The actual source for Platform is compiled based on what platform the target is. So I'd have Platform.h and then PlatformWin.cpp, PlatformLin.cpp etc. Is pimpl valid for that?
 
@Pris You probably don't need Pimpl for that at all. Typically you'd just have Platform.h (shared between all) then Win\platform.cpp, linux\platform.cpp, etc. Then make sorts out which implementation to compile/link for a given target. No need for a pointer at all.
 
@ThePhD it took some mucking about, but I successfully built my last jam entry with clang! (with d3d and all!)
 
@StackedCrooked Missing a space.
IPv632768 should probably be IPv6 32768
 
You probably want pimpl either way to not leak platform-specific things
Including WinAPI headers murders the namespace
 
@Pris You should have a look at Poco's approach. E.g File.h which includes File_WIN32.h or File_UNIX.h depending on the target platform.
 
11:32 PM
You can include specific headers for specific functionality in windows.h.
Only exception is winbase.h which requires windows.h to be included.
 
@StackedCrooked Lol crappy example
 
Or any of the sub headers I suppose.
 
I made my lib non-header-only just so I could hide WinAPI inside
It's really terrible
 
@Rapptz No, I'm quite sure he really means IP version 632768, which has an address size of 64 megabits, allowing every superposition of every qubit in the multiverse to have its own IP address.
 
Actually they don't expose platform internals in the WIN32/UNIX headers. They do that in the corresponding cpp files.
 
11:34 PM
Just got back from a few days away and I see this on meta:
-21
Q: Poorly Received Questions

IsaiahNote - Numbers have changed from original posting and edits I know that you get complaints about this a lot, but I think the community is at fault. I admit some of my early questions were poor, but there isn't much I can do for them. My latest question: Why are static classes poor style had mixe...

I'm surprised nobody from here is involved. :)
 
oh hey that's the guy who complained on meta about us
 
there are people who don't complain on meta about us?
 
@CatPlusPlus I just do LEAN_AND_MEAN and NO_MINMAX and include specific headers.
WIN32_LEAN_AND_MEAN or whatever.
 
@Rapptz IIRC that only removes some ancient 16 bit stuff?
 
Including specific headers is not supported afair
 
11:42 PM
@CatPlusPlus It is.
It tells you not do to it if it doesn't support it, like winbase.h.
@melak47 No it removes other things that aren't commonly used like Crypto stuff.
 
Anyway still rather hide the platform details than to leak them
 
> Define WIN32_LEAN_AND_MEAN to exclude APIs such as Cryptography, DDE, RPC, Shell, and Windows Sockets.
 
hum...what library are compiler intrinsics in? :S
 
The compiler
That's why they're called intrinsics
Also known as built-ins
 
They are intrinsically in headers?
 
11:45 PM
@melak47 intrin.h.
 
@Rapptz headers don't help when you get...
1>main.obj : error LNK2019: unresolved external symbol __ReadWriteBarrier referenced in function "void __cdecl std::_Store_release_1(unsigned char volatile *,unsigned char)" (?_Store_release_1@std@@YAXPCEE@Z)
1>main.obj : error LNK2019: unresolved external symbol __InterlockedExchange8 referenced in function "void __cdecl std::_Store_seq_cst_1(unsigned char volatile *,unsigned char)" (?_Store_seq_cst_1@std@@YAXPCEE@Z)
 
Those aren't intrinsics
 
GCC's and Clang's memcpy is intrinsic, but memcmp isn't.
Such letdown.
 
11:46 PM
Or maybe those are
 
@CatPlusPlus "Some intrinsics, such as __assume and __ReadWriteBarrier, ..."
 
i love msdn docs so much
 
intrinsicko
 
If you're getting link errors then they weren't recognised as intrinsics
 
11:47 PM
but, but are intrinsics intrinsically not in any lib I can link? :S
 
#pragma intrinsic()
 
wut
 
No, compiler inlines code for them
They are never linked to anything
 
"If a function is an intrinsic, the code for that function is usually inserted inline"
usually != always :/
 
yeah I don't get why you're getting linker errors
 
11:48 PM
Is typeid intrinsic? :)
 
because I'm compiling with clang? duh :p
 
Most of them are single instructions. Not much in the way of code at all.
 
Barriers and exchange map to assembly instructions
 
@melak47 The whole point of an intrinsic is that it's code that's generated by the compiler, not linked from a library.
 
> The use of intrinsics affects the portability of code, because intrinsics that are available in Visual C++ might not be available if the code is compiled with other compilers and some intrinsics that might be available for some target architectures are not available for all architectures. However, intrinsics are usually more portable than inline assembly. The intrinsics are required on 64-bit architectures where inline assembly is not supported.
but you knew that right? :v
 
11:49 PM
IIRC the compiler can decide to not inline the intrinsic.
 
Fuck Microsoft for not providing inline asm for x64. lol
 
user3010322
@melak47 Show me how, right now. -
 
There's no way to access the 64-bit divide in MSVC.
 
@melak47 Then it's broken
 
@Mysticial you write inline asm?
 
11:50 PM
@StackedCrooked For things that don't have intrinsics. Such as the 64-bit divide. In the past I had to do it with the add-with-carry as well.
 
@ThePhD I just took out all the stuff that didn't work (std::atomic, see above :v, some boost signals crap because of a bind and old and crappy result_of...)
 
user3010322
Oh.
 
user3010322
I use std::atomic :c
 
@Mysticial wut, idiv not good enough? :)
 
@Mysticial ml64 works just fine.
 
11:52 PM
MinGW supports std::atomic.
 
@StackedCrooked idiv and div are what I want. But I can't use them to do a 128/64-bit divide without inline assembly.
 
user3010322
@Rapptz But MinGW has piss support for D3D.
 
#if defined(__i386__) || defined(__x86_64__)
static __inline__ void __attribute__((__always_inline__, __nodebug__))
__attribute__((__deprecated__("use other intrinsics or C++11 atomics instead")))
_ReadWriteBarrier(void) {
  __asm__ volatile ("" : : : "memory");
}
 
user3010322
Last time I tried it I was chasing IID define problems everywhere.
 
C++11 atomics?
 
11:53 PM
@Mysticial Ah. I heard idiv is very slow and thought you'd avoid it.
 
I'd imagine idiv uses intrinsics.
Seems like a fairly obvious thing to do.
 
@StackedCrooked It is slow, but it's still the fastest thing when you want to divide two arbitrary numbers without any precomputation. Or if you're actually doing the precomputation itself.
 
Would it be slower to promote them to float and use floating point division?
 
The fastest way to emulate it I've found is to convert both operands to double-precision and do two sets of divide/multiply-back-subtract steps.
 
@ThePhD Don't really care about this.
 
11:56 PM
Does DirectDraw still exist?
 
@StackedCrooked Yes, because you need to do it twice which an extra set of corrections since a 53-bit mantissa is not enough to accurate compute the 64-bit quotient.
 
Hi tehre. I made Captive portal for Wi-Fi on C++.
Anyone know what should be answer of success login page to close web dialog?
 
What about long double?
 
user3010322
@StackedCrooked It does, but it's mostly just a shim layer around D3D really.
 
Here it is in full gory, no macro's (unless . counts): i.imgur.com/gY4ZhBE.gifsehe 18 secs ago
@Cinch Vim Master Race
 
11:57 PM
@StackedCrooked MSVC aliases long double to double. There's no way to use 80-bit extended precision in MSVC.
 
user3010322
Sets up a bunch of state and then draws right off.
 
@Mysticial Oh, that sucks.
 
so clang comes with it's own intrin.h, but says "fuck these intrinsics, use C++11 aomtics". and MSVC's <atomic>s are implemented with those intrinsics...so clang on windows is fucked with msvc's stdlib?
 
@StackedCrooked The only advantage of doing the floating-point approach is that it becomes vectorizable. So if you have a bunch of divisions that need to be done, that might be the way to go.
 

« first day (1607 days earlier)      last day (3341 days later) »