Modify

Opened 6 years ago

Closed 6 years ago

#5165 closed Bugs (fixed)

Error in documentaiton "Using smart pointers with Boost.Intrusive containers"

Reported by: DeepThought <deeptho@…> Owned by: igaztanaga
Milestone: To Be Determined Component: interprocess
Version: Boost 1.45.0 Severity: Problem
Keywords: Cc:

Description

The example at http://www.boost.org/doc/libs/1_35_0/doc/html/interprocess/offset_ptr.html is erroneous and misleading.

First of all, some declarations about namespaces are missing.

More importantly, the following line

typedef ip::list<shared_memory_data> shm_list_t;

defines shm_list_t in such a way that it uses standard allocators. This means that the list items are created in normal memory, which is not what the example intends.

Even worse, the "Check all the inserted nodes" test fails to detect this problem.

The example is problematic anyway, because it only deals with one process.

The attachment could serve as a starting point for a good and working example. I suspect you won't like the printf's in it....

Attachments (1)

shm_list.cc (3.6 KB) - added by DeepThought <deeptho@…> 6 years ago.
starting point for working example

Download all attachments as: .zip

Change History (3)

Changed 6 years ago by DeepThought <deeptho@…>

starting point for working example

comment:1 Changed 6 years ago by steven_watanabe

  • Component changed from Documentation to interprocess
  • Owner changed from matias to igaztanaga

comment:2 Changed 6 years ago by igaztanaga

  • Resolution set to fixed
  • Status changed from new to closed

The intention was not to show a full example, just to point that intrusive accepts custom smart pointers. I've fixed the list definition to be an intrusive list in Boost 1.47

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain igaztanaga.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.