Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-04-11 19:25:51


How can I make a macro which, given an integer N, generates a sequence
of
N concatenated Xs?

IOW,

    Xs(0) ->
    Xs(5) -> XXXXX

...and so forth?

Fortunately, in my case I need a string literal so I don't actually need
to catenate them (I can rely on "X" "X" "X" to generate "XXX") but the
problem still looks unreasonably hard-to-solve with BPPL.

TIA,
Dave

+---------------------------------------------------------------+
                  David Abrahams
      C++ Booster (http://www.boost.org) O__ ==
      Pythonista (http://www.python.org) c/ /'_ ==
  resume: http://users.rcn.com/abrahams/resume.html (*) \(*) ==
          email: david.abrahams_at_[hidden]
+---------------------------------------------------------------+


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