Opened 13 years ago

Last modified 12 years ago

#3519 assigned Feature Requests

It should be possible to use consts as external placeholder variables.

Reported by: ami.ganguli@… Owned by: Eric Niebler
Milestone: To Be Determined Component: xpressive
Version: Boost 1.40.0 Severity: Problem
Keywords: Cc:

Description

The right-and-side of placeholder let-expressions are not declared as const, so common use-cases like:

placeholder<int> _i;
smatch what;
what.let(_i = 1);

or:

placeholder<MyClass *> _p;
smatch what;
what.let(_p = this);

fail to compile. It would be nice to have some way to specify a placeholder for non-mutable data. Perhaps:

placeholder<int const> _i;

(suggested by Eric Niebler)

Change History (1)

comment:1 by Eric Niebler, 12 years ago

Status: newassigned
Note: See TracTickets for help on using tickets.