Opened 13 years ago
Closed 12 years ago
#3326 closed Bugs (wontfix)
struct tagging in constructor stops conditional construction without .swap call
Reported by: | Owned by: | Ion Gaztañaga | |
---|---|---|---|
Milestone: | Boost 1.40.0 | Component: | interprocess |
Version: | Boost 1.39.0 | Severity: | Cosmetic |
Keywords: | Cc: |
Description
I'd like to do this:
shared_memory_object shm_obj
(isOwner ? create_only : open_only ,"shared_memory" name ,read_write read-write mode );
but I don't seem to be able to because create_only and open_only are tag structs.
Instead I end up with something like this:
shared_memory_object shm;
if (isOwner) {
shared_memory_object shm_obj (...) shm_obj.swap (shm);
} else {
shared_memory_object shm_obj (...) shm_obj.swap (shm);
}
which isn't as clean imho. What's the rational for a tag struct rather than enum?
Note:
See TracTickets
for help on using tickets.
This is not a bug. Maybe annoying for some but there are no more annoyance reports on this.