Re: List and Maps
- From: "Tom Widmer [VC++ MVP]" <tom_usenet@xxxxxxxxxxx>
- Date: Thu, 09 Nov 2006 15:10:30 +0000
Alamelu wrote:
Hi Tom,
I tried the example given in the Link provided by you,
#include <boost/assign/list_inserter.hpp> // for 'insert()'
using namespace boost::assign;
but it says cannot open include file.
Is this supported in .Net 2003?????????????
Yes. However, you need to download and install boost first. See http://www.boost.org/more/getting_started.html
Note, you don't need to build boost to use the assign library, you just need to download boost, and add the boost directory to your include paths.
This is what i am looking for .......> typedef std::map<CString,std::list> ANI_TYPE_MAP;
const std::list<CString> AniList = {"Cat", "Dog"};
> ANI_TYPE_MAP m_aniMap;
> m_ aniMap [_T(“Animals”)] = AniList
Using non-boost code, that should be:
char const* const AniArray[2] = {"Cat", "Dog"};
std::list<CString> const AniList(AniArray, AniArray + 2);
typedef std::map<CString,std::list> ANI_TYPE_MAP;
ANI_TYPE_MAP m_aniMap;
m_aniMap [_T("Animals")] = AniList;
Using boost, the first 2 lines become:
std::list<CString> const AniList(boost::assign::list_of("Cat")("Dog"));
Tom
.
- Follow-Ups:
- Re: List and Maps
- From: Alamelu
- Re: List and Maps
- References:
- Re: List and Maps
- From: Tom Widmer [VC++ MVP]
- Re: List and Maps
- Prev by Date: Re: List and Maps
- Next by Date: Re: List and Maps
- Previous by thread: Re: List and Maps
- Next by thread: Re: List and Maps
- Index(es):
Relevant Pages
|