I am writing a program that uses Boost's Program Options library and I noticed the following syntax that has haunted me since I saw it:
desc.add_options()
("help","produce help message")
( /* other flag, value, description pairs here */)
;
I see that in the header, operator() is overridden, but I'm not sure how that allows this to be syntactically correct.
Secondly, is there any advantage to this syntax, compared with just calling add_options() multiple times (besides showing off the fact that you can manipulate syntax like this)?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…