Article View: be.comp.programming
Article #1713Re: Rare C++ fout (std::map)
From: Suzan Foster
Date: Wed, 15 Dec 2004 12:24
Date: Wed, 15 Dec 2004 12:24
48 lines
2047 bytes
2047 bytes
Aquila wrote:
> Voor een AI programma krijg ik heel rare fouten met onderstaande code. (Ik
> weet dat het nogal lang is maar ik heb al heel hard gewerkt om het probleem
> te verkleinen).
>
> possiblestate.h:
>
> #ifndef POSSIBLESTATE_H
> #define POSSIBLESTATE_H
>
> class PossibleState{
> public:
> PossibleState(bool);
> PossibleState();
> ~PossibleState();
> bool operator < (const PossibleState &) const;
> private:
> bool turning;
> };
> #endif
>
>
> possiblestate.cpp:
>
> #include "possiblestate.h"
> PossibleState::PossibleState(bool turninger):
> turning(turninger)
> {}
> PossibleState::PossibleState():
> turning()
> {}
ongedefinieerde waarde in turning.
> PossibleState::~PossibleState(){}
> bool PossibleState::operator<(const PossibleState & state) const{
> return turning != state.turning;
> }
deze slaat echt nergens op:
true < false = true
false < true = true
welke is nou lager dan welke?
groetjes, su.
Technical Details
Message-ID:
<41c02cd1$0$65124$e4fe514c@news.xs4all.nl>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsgate.cistron.nl!transit.news.xs4all.nl!post.news.xs4all.nl!not-for-mailReferences:
<ZJKdne45LpA4YyLcRVnyvA@scarlet.biz>Show Full Headers
Complete Article Headers
X-Google-Thread: fcea4,f50cab2f57916087 X-Google-Thread: 107324,f50cab2f57916087 X-Google-Attributes: gidfcea4,gid107324,public X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsgate.cistron.nl!transit.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Date: Wed, 15 Dec 2004 13:24:04 +0100 From: Suzan Foster <http://members.home.nl/foz/foaf.rdf> User-Agent: Mozilla Thunderbird 0.8 (Macintosh/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: be.comp.programming,nl.comp.programmeren Subject: Re: Rare C++ fout (std::map) References: <ZJKdne45LpA4YyLcRVnyvA@scarlet.biz> In-Reply-To: <ZJKdne45LpA4YyLcRVnyvA@scarlet.biz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Lines: 48 Message-ID: <41c02cd1$0$65124$e4fe514c@news.xs4all.nl> NNTP-Posting-Date: 15 Dec 2004 13:23:45 CET NNTP-Posting-Host: 212.52.12.9 X-Trace: 1103113425 news.xs4all.nl 65124 foz/[::ffff:212.52.12.9]:43680 X-Complaints-To: abuse@xs4all.nl