Boost logo

Boost :

Subject: [boost] [variant] assign and access the assigned value simultaneously
From: feverzsj (feverzsj_at_[hidden])
Date: 2014-03-14 02:22:19

hi list,
  for common case:
        boost::variant<Val,...> var;
        var = val;
        Val& v = boost::get<Val>(var);

  why not supply a interface like:

        Val& v = var.assign(val);

  for simplity, and the unnecessary "get" is also elimited.


View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at