Hello, I have 2 questions regarding the Serialization library:<br><br>=========================<br><br>I have a function that I am using to load a serialized class, called &quot;Configuration&quot;. A particular line in the function produces a warning message. Should I be worried about this warning?<br>
<br>The function is below, with a comment denoting the warning-producing line.<br><br><span style="font-family: courier new,monospace;">void Configuration::Save(const string&amp; Name)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">{</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">��� ofstream Out(Name.c_str());</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">��� if(Out.fail())</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">��� ��� throw runtime_error(&quot;Error: unable to save configuration file.&quot;);</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">��� boost::archive::text_oarchive Archiver(Out);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">��� Archiver &lt;&lt; *this; <span style="color: rgb(255, 0, 0);">// This line produces the warning.</span></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">}</span><br><br>The warning is:<br><span style="color: rgb(255, 0, 0);">C4308: negative integral constant converted to unsigned type ... error is from file: \boost\mpl\print.hpp line: 51</span><br>
<br>=========================<br><br>In a separate question, I&#39;m wondering why <span style="color: rgb(0, 102, 0);">this code compiles</span>:<br><span style="font-family: courier new,monospace;">template&lt;class Archive&gt; void save(Archive&amp; ar, const boost::asio::ip::udp::endpoint&amp; endpoint, unsigned int version)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">{</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">��� unsigned short Port = endpoint.port();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">��� ar &lt;&lt; endpoint.address().to_string();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">��� ar &lt;&lt; Port;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">}</span><br><br>But this code <span style="color: rgb(255, 0, 0);">does not compile</span>:<br><span style="font-family: courier new,monospace;">template&lt;class Archive&gt; void save(Archive&amp; ar, const boost::asio::ip::udp::endpoint&amp; endpoint, unsigned int version)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">{</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">��� ar &lt;&lt; endpoint.address().to_string();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">��� ar &lt;&lt; endpoint.port();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">}</span><br><br>The only difference is <span style="font-family: courier new,monospace;">endpoint.port()</span> is stored in a seperate unsigned short.<br>
<br>=========================<br><br>Any help is much appreciated!<br><br>-- Dylan<br>