Boost C++ Libraries: Ticket #5654: Example parse_config_file missing template parameter https://svn.boost.org/trac10/ticket/5654 <pre class="wiki">store(parse_config_file("example.cfg", desc), vm); </pre><p> parse_config_file needs a template parameter in this case. </p> <p> <a href="http://www.boost.org/doc/libs/1_46_1/doc/html/program_options/overview.html#id2218686">http://www.boost.org/doc/libs/1_46_1/doc/html/program_options/overview.html#id2218686</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5654 Trac 1.4.3 Dominic Amann <dominic.amann@…> Tue, 04 Oct 2011 16:10:27 GMT <link>https://svn.boost.org/trac10/ticket/5654#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5654#comment:1</guid> <description> <p> parse_config_file appears to require an open istream object (instead of the filename). I think this is a documentation error? </p> </description> <category>Ticket</category> </item> <item> <author>Olaf van der Spek <olafvdspek@…></author> <pubDate>Tue, 04 Oct 2011 16:51:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5654#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5654#comment:2</guid> <description> <p> Both overloads are available. </p> </description> <category>Ticket</category> </item> <item> <author>Dominic Amann <dominic.amann@…></author> <pubDate>Tue, 04 Oct 2011 18:26:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5654#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5654#comment:3</guid> <description> <p> Ah - perhaps this is a bug in 4.2? The "const char*" overload does not resolve on my system - boost1.42-all-dev on Ubuntu Lucid using g++ 4.4.3. </p> </description> <category>Ticket</category> </item> <item> <author>Olaf van der Spek <olafvdspek@…></author> <pubDate>Tue, 04 Oct 2011 18:36:33 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5654#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5654#comment:4</guid> <description> <p> 4.2? Try 1.47. </p> </description> <category>Ticket</category> </item> <item> <author>Dominic Amann <dominic.amann@…></author> <pubDate>Tue, 04 Oct 2011 18:56:19 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5654#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5654#comment:5</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/5654#comment:4" title="Comment 4">Olaf van der Spek &lt;olafvdspek@…&gt;</a>: </p> <blockquote class="citation"> <p> 4.2? Try 1.47. </p> </blockquote> <p> Sorry - I meant 1.42, but 1.47 is not readily available for me (as in not packaged in backports), and since the workaraound is acceptable, and the project late (as ever), I won't get around to this I am afraid. I can confirm that it does not work with an extra (true or false) template parameter either. But I guess bugs for 1.42 are somewhat irrelevant at this stage. </p> </description> <category>Ticket</category> </item> <item> <author>Olaf van der Spek <olafvdspek@…></author> <pubDate>Tue, 04 Oct 2011 18:57:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5654#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5654#comment:6</guid> <description> <p> Maybe (probably) this feature was added after 1.42. </p> </description> <category>Ticket</category> </item> <item> <author>Dominic Amann <dominic.amann@…></author> <pubDate>Tue, 04 Oct 2011 19:04:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5654#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5654#comment:7</guid> <description> <p> It is declared in the header I have. </p> <pre class="wiki"> template&lt;class charT&gt; #if ! BOOST_WORKAROUND(__ICL, BOOST_TESTED_AT(700)) BOOST_PROGRAM_OPTIONS_DECL #endif basic_parsed_options&lt;charT&gt; parse_config_file(const char* filename, const options_description&amp;, bool allow_unregistered = false); </pre> </description> <category>Ticket</category> </item> <item> <author>Olaf van der Spek <olafvdspek@…></author> <pubDate>Tue, 04 Oct 2011 19:13:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5654#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5654#comment:8</guid> <description> <p> So what error msg do you get when you try the example? </p> </description> <category>Ticket</category> </item> <item> <author>Dominic Amann <dominic.amann@…></author> <pubDate>Tue, 04 Oct 2011 19:14:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5654#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5654#comment:9</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/5654#comment:8" title="Comment 8">Olaf van der Spek &lt;olafvdspek@…&gt;</a>: </p> <blockquote class="citation"> <p> So what error msg do you get when you try the example? </p> </blockquote> <pre class="wiki">../src/main.cpp:56: error: no matching function for call to ‘parse_config_file(const char [20], boost::program_options::options_description&amp;)’ </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 14 Nov 2011 14:26:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5654#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5654#comment:10</guid> <description> <p> Was that fixed or is there any workaround? Got same error with boost 1.47 and GCC 4.6.2. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 23 Mar 2012 15:32:51 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5654#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5654#comment:11</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/5654#comment:10" title="Comment 10">anonymous</a>: </p> <blockquote class="citation"> <p> Was that fixed or is there any workaround? Got same error with boost 1.47 and GCC 4.6.2. </p> </blockquote> <p> Write: parse_config_file&lt;char&gt;(......); and it works. </p> </description> <category>Ticket</category> </item> <item> <author>Victor Tseng <palatis@…></author> <pubDate>Sun, 12 Aug 2012 20:33:54 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5654#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5654#comment:12</guid> <description> <p> shouldn't this function be declared as </p> <pre class="wiki"> template&lt;class charT&gt; #if ! BOOST_WORKAROUND(__ICL, BOOST_TESTED_AT(700)) BOOST_PROGRAM_OPTIONS_DECL #endif basic_parsed_options&lt;charT&gt; parse_config_file(const charT* filename, const options_description&amp;, bool allow_unregistered = false); </pre><p> and just ignore those people who tries to pass an int* or double* or whatever* to it? </p> </description> <category>Ticket</category> </item> </channel> </rss>