Boost logo

Boost Users :

Subject: Re: [Boost-users] query regarding parallel algorithms and error message
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2018-06-25 23:57:26


AMDG

On 06/25/2018 12:49 PM, ian D Chivers via Boost-users wrote:
>
> $ g++ -Ofast -std=c++11 -Wl,--stack,0x100000000 ch3604.cxx
> ch3604.cxx: In function ‘int main()’:
> ch3604.cxx:155:16: error: ‘parallel_stable_sort’ is not a member of ‘boost::sort’
> boost::sort::parallel_stable_sort( x.begin() , x.end() );
> ^~~~~~~~~~~~~~~~~~~~
>

Are you sure that you're not missing a #include?
It works for me.

#include <boost/sort/sort.hpp>
#include <vector>

int main() {
  std::vector<int> x = { 3, 1, 4 };
  boost::sort::parallel_stable_sort( x.begin() , x.end() );
}

>
> <snip>
> gcc version 7.3.0 (GCC)
> <snip>
> Microsoft (R) C/C++ Optimizing Compiler Version 19.13.26129 for x64
> <snip>
>
> ch3604.cxx
>
> C:\Program Files\boost\boost_1_67_0\boost/sort/parallel_stable_sort/parallel_stable_sort.hpp(132): error C2146: syntax error: missing ')' before identifier 'or'
>> <snip>
>
> I presume that if I replace the or with something belonging to an earlier standard that this may get me a bit further.
>

`or` was a keyword in C++98 (See [lex.digraph]). Try
compiling with /permissive-

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net