EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: StandardString should be a template?
From: "Jeff Hill" <[email protected]>
To: "'Andrew Johnson'" <[email protected]>
Cc: [email protected]
Date: Mon, 1 Nov 2010 10:10:49 -0600
Hi Andrew,

The latest Microsoft compiler complains if there is any class
that is being exported from a dll which has UDT member 
data that is not also being exported. This causes problems, for 
example, with StandardString which has a std :: string member 
data which is not a dll exported class. I don?t know 
quite what to do about this particular situation because 
exporting std :: string is maybe not a good idea (certainly 
there could be multiply defined symbols if more than one dll 
actually started doing this). It just may not be a good idea 
to embed STL data members in DLL interface classes. One solution
would be to make StandardString into a template (which wouldn?t be
a dll exported class). That would also make it more generally 
useful if it were to be based on the same template arguments as 
basic_string<charT, traits, Alloc>.

In this context, it occurs to me that it would be quite useful 
if we had a global template function like this declared in 
BasicString.h which could be used also in the implementation of 
StandardString<charT, traits, Alloc>.

template <charT, traits, Alloc>
void append ( std :: string &, const basic_string<charT, traits, Alloc> & );

The global template function almost seems to be a no-brainer so 
I will probably go ahead and implement it in the cvs trunk branch so 
that I can immediately work around this issue.

I can also morph StandardString into 
StandardString<charT, traits, Alloc> as you see fit.

Comments?

Jeff
______________________________________________________
Jeffrey O. Hill           Email        [email protected]
LANL MS H820              Voice        505 665 1831
Los Alamos NM 87545 USA   FAX          505 665 5107

Message content: TSPA

With sufficient thrust, pigs fly just fine. However, this is
not necessarily a good idea. It is hard to be sure where they
are going to land, and it could be dangerous sitting under them
as they fly overhead. -- RFC 1925





Navigate by Date:
Prev: RE: epicsEvent semantics Jeff Hill
Next: RE: what was the time before 1990? Davidsaver, Michael
Index: 2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: epicsEvent semantics Eric Norum
Next: Patch to subArray record Michael Abbott
Index: 2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·