VanLam's blog

By VanLam, history, 20 months ago, In English

I've just learned about ordered set. I tried to use these templates

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> multi_ordered_set;

But I'm using Macbook, so I couldn't compile it. How can I fix that? Thanks for your help.

  • Vote: I like it
  • +8
  • Vote: I do not like it

»
20 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

use GCC not Clang

»
20 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I followed the instructions at my own tutorial and I can use them on Mac just fine:

https://codeforces.me/blog/entry/136984

Minimal working example

»
20 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I think there’s a bug in macOS 15.4. Before updating, PBDS was working fine on my Mac. If anyone’s got a fix, let us know!

»
20 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Just run brew install gcc@14 and compile by g++-14 program.cpp [arguments]