Re: std::map explicit instantiation

Discussion in 'C++' started by Rolf Magnus, Jul 23, 2003.

  1. Rolf Magnus

    Rolf Magnus Guest

    George wrote:

    > Hi everyone
    >
    > I have a problem with std::map explicit instantiation.
    > I can't do it as it should be.
    > Maybe someone can help me.
    >
    > Source code for vc71 (dll):
    >
    > #define MY_API _declspec(dllexport)
    >
    > #include <map>
    >
    > class MY_API MyClass {
    > public:
    >
    > template class MY_API std::allocator<int>;
    >
    > template class MY_API std::allocator<std::pair<int, int> >;
    > typedef std::allocator<std::pair<int, int> > MyPairAlloc;
    >
    > template struct MY_API std::less<int>;
    > template class MY_API std::map<int, int, std::less<int>,
    > MyPairAlloc>; typedef std::map<int, int, std::less<int>, MyPairAlloc>
    > MyMap;
    >
    > MyMap m_map;
    > };
    >
    >
    > Output:
    > map(77) : warning C4251: 'std::_Tree_nod<_Traits>::_Alnod' : class
    > 'std::allocator<_Ty>' needs to have dll-interface to be used by
    > clients of class 'std::_Tree_nod<_Traits>'


    Since dlls and their interface quirks are not defined by the C++
    standard, this warning is platform specific. You should ask your
    question in a Windows programming newsgroup.
    Rolf Magnus, Jul 23, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Jansson
    Replies:
    5
    Views:
    6,253
    Ivan Vecerina
    Mar 17, 2005
  2. Replies:
    1
    Views:
    552
    Salt_Peter
    Dec 25, 2006
  3. Replies:
    1
    Views:
    401
    red floyd
    Dec 21, 2008
  4. Thomas J. Gritzan
    Replies:
    6
    Views:
    991
    James Kanze
    Dec 22, 2008
  5. James Kanze
    Replies:
    0
    Views:
    1,974
    James Kanze
    Dec 21, 2008
Loading...

Share This Page