<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: CLI in C++: The Ideal Solution</title>
	<link>https://codesynthesis.com/~boris/blog//2009/06/28/cli-cxx-the-ideal-solution/</link>
	<description>Boris Kolpackov's blog about software</description>
	<pubDate>Wed, 22 Apr 2026 12:14:57 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Boris Kolpackov</title>
		<link>https://codesynthesis.com/~boris/blog//2009/06/28/cli-cxx-the-ideal-solution/#comment-805</link>
		<author>Boris Kolpackov</author>
		<pubDate>Sat, 18 Jul 2009 01:07:54 +0000</pubDate>
		<guid>https://codesynthesis.com/~boris/blog//2009/06/28/cli-cxx-the-ideal-solution/#comment-805</guid>
		<description>Jesse,

Thanks, I am glad you are enjoying both (the blog and XSD).

Regarding Fusion's associative tuples: This is the same approach as the one used in the CLI parser from libcult which is discussed in the next post. In particular, there is the limit on how many tuples you can have in the map (10 by default, which is way too low for a CLI parser). They also use partial template specialization to implement all this apparatus.

As mentioned in the next post, this approach does not scale to a large number of options (say, 100). In this case the compilation time and the object code size (due to the enormous symbol length) become unacceptable. There is also the verbosity problem since we have to repeat each option name at least three times.

The implementation can be improved using the C++0x variadic templates feature. There is nothing that we can do about the verbosity problem, however (see the next two posts for details).

But nice idea, nevertheless. This is probably as good as we can get if we have to define the command line interface in the C++ source code.</description>
		<content:encoded><![CDATA[<p>Jesse,</p>
<p>Thanks, I am glad you are enjoying both (the blog and XSD).</p>
<p>Regarding Fusion&#8217;s associative tuples: This is the same approach as the one used in the CLI parser from libcult which is discussed in the next post. In particular, there is the limit on how many tuples you can have in the map (10 by default, which is way too low for a CLI parser). They also use partial template specialization to implement all this apparatus.</p>
<p>As mentioned in the next post, this approach does not scale to a large number of options (say, 100). In this case the compilation time and the object code size (due to the enormous symbol length) become unacceptable. There is also the verbosity problem since we have to repeat each option name at least three times.</p>
<p>The implementation can be improved using the C++0x variadic templates feature. There is nothing that we can do about the verbosity problem, however (see the next two posts for details).</p>
<p>But nice idea, nevertheless. This is probably as good as we can get if we have to define the command line interface in the C++ source code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse</title>
		<link>https://codesynthesis.com/~boris/blog//2009/06/28/cli-cxx-the-ideal-solution/#comment-804</link>
		<author>Jesse</author>
		<pubDate>Wed, 15 Jul 2009 01:11:03 +0000</pubDate>
		<guid>https://codesynthesis.com/~boris/blog//2009/06/28/cli-cxx-the-ideal-solution/#comment-804</guid>
		<description>I'm sorry that I don't have time to come up with a concrete code suggestion, but I'm wondering if Boost Fusion's associative tuples might be able to come to the rescue. 

Very interesting blog, a pleasure to read! Also, I've been using XSD in a project and it's very nice! Thanks.</description>
		<content:encoded><![CDATA[<p>I&#8217;m sorry that I don&#8217;t have time to come up with a concrete code suggestion, but I&#8217;m wondering if Boost Fusion&#8217;s associative tuples might be able to come to the rescue. </p>
<p>Very interesting blog, a pleasure to read! Also, I&#8217;ve been using XSD in a project and it&#8217;s very nice! Thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
