Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualHodgman

Posted 07 December 2012 - 06:43 PM

b) there aren't volatile overloads in the standard library?

As sik mentioned above, it's only useful for programming at a level where you're interacting with some hardware detail, not general use. So there's not much incentive in adding overloads to ostream that only driver-authors will use (or won't use).
IMHO, I actually prefer the style where you read memory into local variables before using it anyway:
volatile char* data = ..
char c = *data;
cout << c;

didn't support any form of threading

I try and avoid mentioning threading and volatile in the same sentence, because too many people already think they go hand in hand. If you're using the C++11 standard library's threading primitives, you don't need volatile. You only need it when interacting with hardware designed to support multi-threaded code, such as when implementing said primitives, or if you're writing dangerous multi-threaded code that makes assumptions about the underlying hardware.

#1Hodgman

Posted 07 December 2012 - 06:40 PM

b) there aren't volatile overloads in the standard library?

As sik mentioned above, it's only useful for programming at a level where you're interacting with some hardware detail, not general use. So there's not much incentive in adding overloads to ostream that only driver-authors will use (or won't use).
IMHO, I actually prefer the style where you read memory into local variables before using it anyway:
volatile char* data = ..
char c = *data;
cout << c;

didn't support any form of threading

I try and avoid mentioning threading and volatile in the same sentence, because too many people already think they go hand in hand. If you're using the C++11 standard library's threading primitives, you don't need volatile. You only need it when interacting with hardware designed to support multi-threaded code, such as when implementing said primitives.

PARTNERS