Opened 4 years ago

Last modified 3 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


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 Changed 4 years ago by viboes

Component: Nonealgorithm
Owner: set to Marshall Clow

comment:2 Changed 4 years ago by Marshall Clow

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 Changed 3 years ago by stevenross

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:

Neil Groves has agreed to look into it.

comment:4 Changed 3 years ago by anonymous

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.