[prev in list] [next in list] [prev in thread] [next in thread] 

List:       boost-users
Subject:    [Boost-users] serialization:  problem with abstract base  class
From:       "RIVASSEAU Jean Noel" <JN.RIVASSEAU () oberthurcs ! com>
Date:       2006-02-27 13:25:52
Message-ID: 87F60F7FA02FF749AFB02BD9FCAA6B04DA7AA2 () naserv31 ! nanterre ! oberthurcs ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello

 

The following code (attached) demonstrate a problem that I have. I am trying to \
serialize via pointer to base class (MObject) which is abstract. The docs say that a \
compile error will occur when trying to do that. I don't have any compile time errors \
emitted but the build fails at link time (it does not instantiate the save/load code \
for the abstract base class).

 

The solutions provided in the docs are: write BOOST_IS_ABSTRACT(MObject): I did that \
and nothing changes;

 

Or

 

Implement is_abstract for your compiler. I do not understand what this means. Can you \
help me out ?

 

 

Currently the only workaround I have is to not make the base class abstract, but I \
would like it to be abstract...

 

Jean-Noël


[Attachment #5 (text/html)]

<html xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=FR link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hello<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>The following code (attached) demonstrate a problem
that I have. I am trying to serialize via pointer to base class (MObject) which
is abstract. The docs say that a compile error will occur when trying to do
that. I don&#8217;t have any compile time errors emitted but the build fails at
link time (it does not instantiate the save/load code for the abstract base
class).<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>The solutions provided in the docs are: write
BOOST_IS_ABSTRACT(MObject): I did that and nothing \
changes;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Or<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Implement is_abstract for your compiler. I do not
understand what this means. Can you help me out ?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Currently the only workaround I have is to not make
the base class abstract, but I would like it to be \
abstract&#8230;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Jean-Noël<o:p></o:p></span></font></p>

</div>

</body>

</html>


["abstract_class_problem.zip" (application/x-zip-compressed)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic