gcc 6是否支持使用std :: sample(c ++ 17)?

T.L*_*T.L 6 c++ gcc gcc6 c++17

我正在尝试使用以下命令来编译包含使用gcc版本6.3.0的这段c ++ 17代码:std::sampleg++ -std=gnu++17 -c main.cpp

但是我明白了:error: ‘sample’ is not a member of ‘std’...

#include <vector>
#include <algorithm>
#include <random>

int main()
{
    std::vector<int> a{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
    std::vector<int> b(5);

    std::sample(a.begin(), a.end(), 
                b.begin(), b.size(),
                std::mt19937{std::random_device{}()});

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

gcc 6是否支持使用 std::sample?(使用gcc 8.2.0可以正常编译)

我在这两页上找不到答案: