Boost C++ Libraries: Ticket #2566: Cannot have a 'short' member in a bundled property when saving with read_graphml https://svn.boost.org/trac10/ticket/2566 <p> I have a graph with a bundled property whose one of the members is a 'short'. When calling read_graphml, it throws an exception: </p> <p> terminate called after throwing an instance of 'boost::exception_detail::clone_impl&lt;boost::exception_detail::error_info_injector&lt;boost::bad_any_cast&gt; </p> <blockquote class="citation"> <p> ' </p> </blockquote> <blockquote> <p> what(): boost::bad_any_cast: failed conversion using boost::any_cast </p> </blockquote> <p> Same problem with 'unsigned short'. With 'int' and 'long', it works. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2566 Trac 1.4.3 Jeremiah Willcock Tue, 07 Apr 2009 16:47:16 GMT owner, status changed https://svn.boost.org/trac10/ticket/2566#comment:1 https://svn.boost.org/trac10/ticket/2566#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Douglas Gregor</span> to <span class="trac-author">Jeremiah Willcock</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> It appears that there is a one-to-one mapping between GraphML attribute types and data types in bundled properties. Therefore, it is likely not possible to allow other data types in bundled properties within the current implementation of the GraphML reader. Is it possible to change your bundled property to an int type instead? Otherwise, when you are setting up your dynamic_properties structure, you could wrap the property map in one that does the casts back and forth between int and short. </p> Ticket remi.chateauneu@… Tue, 07 Apr 2009 21:15:10 GMT <link>https://svn.boost.org/trac10/ticket/2566#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2566#comment:2</guid> <description> <p> "change your bundled property to an int" This is what I did and it is OK (It was an IP port number which fits in an int of course). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Wed, 08 Apr 2009 14:54:10 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2566#comment:3 https://svn.boost.org/trac10/ticket/2566#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> Closing as wontfix because this would seem to require a rewrite of the reader to solve. </p> Ticket