Boost logo

Boost :

From: Michiel Salters (Michiel.Salters_at_[hidden])
Date: 2001-03-05 09:23:31


-----Original Message-----
From: David Abrahams [mailto:abrahams_at_[hidden]]
Sent: Monday, March 05, 2001 2:25 PM
To: boost_at_[hidden]
Subject: Re: [boost] Named template parameters

> A small issue with the code - we don't need a semicolon after
> BOOST_NAMED_TEMPLATE_PARAMETER macro invocation, and CW6.1 issues the
> "illegal empty declaration" warning for it:

> Where possible, I like to arrange macros so that the trailing semicolon is
> required. Can that be done?

> -Dave

The traditional trick is

# define X(args) do { \
... \
... \
while (false)

This executes the body once, requires a ; and should
compile to a NO-OP.

Regards,
Michiel Salters


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk