Opened 8 years ago

Last modified 7 years ago

#11202 new Bugs

boost.sort header conflicts with boost.range header

Reported by: john2.718281828459045235360287@… Owned by: Neil Groves
Milestone: To Be Determined Component: range
Version: Boost 1.58.0 Severity: Problem
Keywords: sort Cc: stevenross

Description

This two-line program fails to compile.

#include <boost/range/algorithm.hpp>
#include <boost/sort/spreadsort/spreadsort.hpp>

The headers conflict on "boost::sort". The first header declares a function boost::sort. The second header declares a namespace boost::sort.

Change History (4)

comment:1 by viboes, 7 years ago

Component: Nonealgorithm
Owner: set to Marshall Clow

comment:2 by Marshall Clow, 7 years ago

Component: algorithmsort
Owner: changed from Marshall Clow to Paul A. Bristow

This is definitely not me. This belongs to Steven Ross, maintainer of the Boost.Sort library.

comment:3 by stevenross, 7 years ago

Cc: stevenross added
Component: sortrange
Keywords: sort added
Owner: changed from Paul A. Bristow to Neil Groves

This is due to the "using range::sort" at the bottom of boost/range/algorithm/sort.hpp (fixing this also requires renaming uses of boost::sort to boost::range::sort). It's causing namespace pollution by putting a function in the boost:: namespace, that's conflicting with the boost::sort library. It's also a violation of this guideline: https://svn.boost.org/trac/boost/wiki/Guidelines/MaintenanceGuidelines#Avoidtheinclusionofsymbolsattheboostorboost::detailnamespace

Neil Groves has agreed to look into it.

comment:4 by anonymous, 7 years ago

I know, Boost is a project of volunteers but I just stumbled over the same issue. And since there is no +1 and the last activity has been months ago I figured I just put a comment here to bring that ticket to your attention again.

Note: See TracTickets for help on using tickets.