[cfe-dev] libcxx - uniform_int

Mat Balazsi via cfe-dev cfe-dev at lists.llvm.org
Wed Jun 22 17:33:16 PDT 2016


Hello,

I am trying to compile some code using clang++ (version clang-703.0.31)
installed from xcode (version 7.3.1). I have included the -std=c++11  and
-stdlib=libc++ flags, yet I always get the following:
  error:  no member named 'uniform_int' in namespace 'std'

Other methods from <random> seem to be working, such as
uniform_int_distribution. Is uniform_int deprecated?


regards,
Matthew Balazsi


PS: to reproduce the issue, I compiled the following

 clang++ -std=c++11 -stdlib=libc++  main.cpp;  ./a.out

------------------------------------------------------------------------
main.cpp
------------------------------------------------------------------------
#include <random>
using namespace std;

int main(int argc,char *argv[])
{
    std::uniform_int<int> unigen;
    std::uniform_int_distribution<int> distribution(0, 99);
    return 0;
}
------------------------------------------------------------------------

main.cpp:9:7: error: no member named 'uniform_int' in namespace 'std'
        std::uniform_int<int> unigen;
        ~~~~~^
main.cpp:9:22: error: expected '(' for function-style cast or type
construction
        std::uniform_int<int> unigen;
                         ~~~^
main.cpp:9:24: error: use of undeclared identifier 'unigen'
        std::uniform_int<int> unigen;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160622/05766553/attachment.html>


More information about the cfe-dev mailing list