Boost logo

Boost :

From: Dennis D Bingaman (ddbingaman_at_[hidden])
Date: 2007-06-20 11:18:58

Are you sure this is not an error:

if (mode != read_write || mode != read_only){

mode can only be equal to read_write or to read_only thus is it ALWAYS not
equal to the other and this expression will always evaluate to true.

Dennis Bingaman

Sent by: boost-bounces_at_[hidden]
06/20/2007 09:48 AM
Please respond to


[boost] Boost.Interprocess file_mapping strange error.

Hi !


I use the Interprocess library version 2006-10-13.


I try to test the file_mapping class and I get a really strange error. I
use VS 2005 to compile the stuff.


This is my short example


namespace ip = boost::interprocess;

ip::file_mapping mf ("test_file", ip::read_write);


So when I debug this code: the debugger enter to the file_mapping
constructor, next evaluate the following line:


   //Check accesses

   if (mode != read_write || mode != read_only){

      error_info err = other_error;

      throw interprocess_exception(err);





And it throws the error. So I really don't understand why it does it.



Thank you.


Ce message et toutes les pieces jointes (ci-apres le "message") sont
confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite.
Tout message electronique est susceptible d'alteration.
Societe Generale Asset Management et ses filiales declinent toute
responsabilite au titre de ce message s'il a ete altere, deforme ou
Decouvrez l'offre et les services de Societe Generale Asset Management sur
le site
This message and any attachments (the "message") are confidential and
intended solely for the addressees.
Any unauthorised use or dissemination is prohibited.
E-mails are susceptible to alteration.
Neither Societe Generale Asset Management nor any of its subsidiaries or
affiliates shall be liable for the message if altered, changed or
Find out more about Societe Generale Asset Management's proposal on
Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at