G++'s statements as expressions feature

2008-03-01 Thread davin.pear...@gmail.com
Consider the following code: #include int main() { std::cout << ({(void)123; "apple";}) << '\n'; // * std::cout << ({(void)123; (const char*)"apple";}) << '\n'; } The line marked * gives the following compilation error: cd d:/home/3-autogc-nosplit/ make 2008/tests/t-22-bug.run * Compilin

Trouble debugging some STL code

2018-01-24 Thread davin.pear...@gmail.com
#include #include #include #include #include #include std::ostream& operator << (std::ostream& o, const std::pair p) { o << p.first << " " << p.second << std::endl; return o; } std::ostream& operator << (std::ostream& o, const std::map& map) { typename std::map::iterator it = map.

Re: Trouble debugging some STL code

2018-01-25 Thread davin.pear...@gmail.com
Thank you for taking the time to fix my bug. It becomes obvious when the solution is presented to me. On Friday, January 26, 2018 at 8:52:06 AM UTC+13, Richard Kettlewell wrote: > writes: > > std::ostream& operator << (std::ostream& o, const > > std::map& map) > > { > >typename std::map::it

Re: Trouble debugging some STL code

2018-01-28 Thread davin.pear...@gmail.com
The following code generates a linker error: #include #include #include #include #include #include #include class Writer { public: Writer& operator << (const char* s) { for (const char* ch = s; *ch != 0; ++ch) { printf("%c",*ch); } return *this; }

Re: Trouble debugging some STL code

2018-02-04 Thread davin.pear...@gmail.com
On Tuesday, January 30, 2018 at 4:36:16 AM UTC+13, Richard Kettlewell wrote: > "davin.pearson" writes: > > > The following code generates a linker error: > [...] > > You’ve tried to explicitly instantiate a template, but got the syntax > wrong. See > https://gcc.gnu.org/onlinedocs/gcc/Template-In

Please help me debug my C++ code

2018-04-02 Thread davin.pear...@gmail.com
Here is the location of my files: http://davinpearson.com/binaries/map-20180403-100601.tar.gz When I try to link map/map.cc it gives me the following error message: -*- mode: compilation; default-directory: "~/lisp++-projects/" -*- Compilation started at Tue Apr 3 09:54:15 cd ~/lisp++-projects