stl function adapter to compare struct member I've wondered if I'm missing something when I do searches in stl collections, to find an element that has a member that has a certain value. I don't want to have to write any special function object or accessor function, there should be a function adaptor that takes a member pointer (not a member function pointer.... 13 Jun 2010 06:07
Templates rejected on non-dependent parameters before deduction in C++0X? On 11 Jun., 03:13, Jesse Perla <jessepe...(a)gmail.com> wrote: (I attempted to post this to comp.std.c++ but it didn't seem to pass moderation, so I thought this is a 2nd best location) I replied to your question on comp.std.c++, but it is not visible at the time of writing this. Since already one of my further... 11 Jun 2010 07:01
Member Initialization Lists One of many questions I typically ask candidates who come to interview with me is this one: class A { public: A() : y(2), x(y * 2) {} ~A() {} private: int x; int y; }; int main() { A a; return 0; } I ask them what the value of a.x and a.y will be after 'a' has been constructed. ... 15 Jun 2010 04:20
Templates rejected on non-dependent parameters before deduction in C++0X? (I attempted to post this to comp.std.c++ but it didn't seem to pass moderation, so I thought this is a 2nd best location) While doing some meta-programming for choosing a return type of an overloaded function, I ran into a problem with the expansion of templates in the return type of overloaded functions (that a... 10 Jun 2010 21:15
C++ FAQ On Jun 3, 1:54 pm, Marshall Cline <cl...(a)parashift.com> wrote: <snip> Polish http://klub.chip.pl/b.krzemien/c++-faq-pl/ <snip> Poland http://klub.chip.pl/b.krzemien/c++-faq/ Please be advised: The above links seem to be broken (as of June 9, 2010 22:00 UTC) Piotr { the main FAQ Lit... 10 Jun 2010 16:46
A quick question about Initializer-List in C++0x Hi Everybody! I just tried to compile the following with gcc-4.5 in c++0x mode: int main (int argc, char* argv[]) { std::map<std::string, std::vector<std::string>> m { {"Hello", {"Good", "World"}}, {"Goodbye", {"Rude", "World"}} }; return 0; } However I get compilation errors when I d... 9 Jun 2010 14:11
Critique of code quality I am aiming to produce the best balance of speed and space efficiency against reliability and maintainability placing a higher weight on the latter criteria. http://www.ocr4screen.com/UTF8.h If there are any improvements that can be made within the criteria provided, or other improvements that do not detract... 20 Jun 2010 04:49
How to reuse an existing stream with a different streambuf ? Hello, Some days ago, I decided that it would be fun to write a `streambuf` subclass that would use `mmap` and read-ahead. I looked at how my STL (SGI) implemented `filebuf` and realized that `basic_filebuf` contains a `FILE*`. So inheriting from `basic_filebuf` is out of the question. So I inherited from `ba... 8 Jun 2010 13:41
VisualC++ vs GCC: read in a number in exponential notation Dear all! I'm writing a fairly simple program interpreting an input with numbers in exponential notation. I have encountered a problem in MS VisualC++ 2008 Express Edition which is illustrated in the following code: #include <iostream> #include <string> #include <sstream> using namespace std; int main()... 10 Jun 2010 21:15
Static variable in template function Hi all, the following function writes n bits data to file. Parameter named 'Data' contains the value to be written, 'Length' contains the number of bits of 'Data' to write. This function uses a static buffer named BitBuffer to store bits between calls. When BitBuffer is full it is written to file. void Writ... 9 Jun 2010 00:59 |