First  |  Prev |  Next  |  Last
Pages: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Compiler ordering barriers in C++0x
Will it be possible to issue only compiler ordering barrier (release, acquire or full), but not hardware ordering barrier in C++0x? Accesses to volatile variables are ordered only with respect to accesses to other volatile variables. What I want it to order access to variable with respect to accesses to all other... 6 May 2008 22:21
C++ and POSIX threads
Dear all, When one has a class, class Q { int s; type *ptr; //array with s elements. public: //constructors, assignment operator void gg(int *sum, int sz); //destructor }; and want to use pthread_create() to cre... 24 Apr 2008 02:52
exception base class
Hello, for debugging purposes, I am using next base class for my exception classes: class ErrorBase { /*- Class invariants : What must be true after each call to a public * interface */ public: explicit ErrorBase( const std::string &txt ); ErrorBase( const... 23 Apr 2008 15:44
N2575: Initializer lists - Alternative mechanism and rationale
I've just read N2575 and welcome its proposals. N2575 takes a step back and provides a simple but brilliant programmer's perspective: the division of concerns into conversions and constructor calls. Here's some feedback. 1. In my view conversion is the important feature of the initializer list proposals. The o... 23 Apr 2008 14:55
A Set of Questions About Console I/O and Structures...
Here goes my list of questions that have been bugging me for a couple of days. 1. It seems that console I/O with "cout <<" and "cin >>" results in a bloated executable, whereas I/O functions from C such as printf() and scanf() make smaller, faster programs. Are there any other C/C++ console I/O functions avail... 24 Apr 2008 02:04
How to build a string on the fly, using std::ostringstream?
Does the Standard Library support creating an std::string by means of streaming, without having to declare a *named* ostringstream object? I tried the following: #include <sstream> #include <string> int i = 42; std::string s = (std::ostringstream() << "i = " << i).str(); Of course it didn't co... 7 May 2008 12:35
Nested variable declarations using the same name
Hi, I was wondering what is the point of the language supporting nested variable declarations of the same name? For example: int a = 0; if( some_bool ) { int a = 5; ... } cout << a; //this outputs 0 I can't think of a reason why this would be supported, and I feel the compiler should t... 24 Apr 2008 16:39
a concurrent programming abstraction
Hi, This may not be the best place to post this question, but I didn't know who to ask, so sorry if this is a bit off topic. I have the following algorithm, that I want to execute in a separate thread, so that I do not block the main one: void findBest() { for ( Element elem : collection ) // foreach ... 23 Apr 2008 14:55
Efficient sorting
Hello, In another exercise I was trying, I am trying to write an efficient sorting algorithm. Here's mine, with a random number generator at the end to make testfiles. How do I improve the efficiency of the sorting process? I've read about the various techniques but without statistical analysis it is not imme... 24 Apr 2008 16:39
pitfalls of string for binary data
At a prior job, people were using std::string to hold arbitrary binary data, as opposed to vector<char>. I've seen a few people in this group poopoo that notion, and I'd like to find out what they think the pitfalls, if any, of using string to hold binary data are. I ask, because otherwise the code base was pretty ... 23 Apr 2008 15:44
First  |  Prev |  Next  |  Last
Pages: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22