Syntax error using signal1 from Boost 1.34.1 on VC6

I am trying to use Boost signals to set up events with VC6. I discovered that build 1.34.1 is the last build to support VC++ 6.0, so that is the version I need to compile with. I noticed from the Signals tutorial on the Boost site that for VC++ 6.0, I have to use the portable syntax. So I declared my signal: #include <boost\signals.hpp> #include <boost\signals\signal1.hpp> #include <vector> typedef boost::signal1<void, std::vector<unsigned char>> signal_t; I am using a vector of unsigned chars as a parameter to the signal handler (event handler), since I am essentially receiving data from an ethernet connection, parsing it, and sending it through the event back to the subscriber. Now the error. using the above code, I get the following error: error C2146: syntax error: missing ',' before identifier 'signal_t' I'm pretty sure I checked and double-checked the syntax several times, comparing it to the example in the signals tutorial. All I can think of is that a vector is not supported as a parameter, yet it was for version 1.46 that I tried earlier. Am I doing anything wrong? Quick responses are much appreciated! Thanks! Chris

Igor R <boost.lists <at> gmail.com> writes:
typedef boost::signal1<void, std::vector<unsigned char>> signal_t;
Do you have a space between ">>" in your real code?
I hate when I make those "all too obvious and stupid" mistakes. Problem corrected. Thanks!

On 05/17/2011 02:49 PM, tangleman@secules.net wrote:
typedef boost::signal1<void, std::vector<unsigned char>> signal_t;
a common pitfall you may run into when using C++ templates is that '>>' is treated by the compiler as an operator, namely 'right-shift' operator (operator>>()). in order to avoid this issue you should always use a space between the '>' characters when instantiating nested templates. have a look in
participants (4)
-
Adam Romanek
-
Igor R
-
Tangleman
-
tangleman@secules.net