Re: Using #include <random>

182 views
Skip to first unread message

RichardC

unread,
Jan 15, 2013, 9:31:13 AM1/15/13
to andro...@googlegroups.com
Using: android-ndk-r8d, GCC 4.6 and defining -std=gnu++11

std::mt19937 generator;

Compiled for me (note: std:: not std::tr1)
 

On Tuesday, January 15, 2013 5:30:18 AM UTC, Hyon Lim wrote:
Hi.
I'm trying to use std::tr1 feature for random generator.

std::tr1::mt19937 generator;  // a core engine class
std::tr1::normal_distribution<int> normal(g_mean, g_sigma);

However compiler gives following error even I specified tr1 namespace.

Users/hyon/Codes/quadrover/Playground/jni/../cpp/BRIEF.h:9: error: 'tr1' is not a namespace-name
/Users/hyon/Codes/quadrover/Playground/jni/../cpp/BRIEF.h:9: error: expected namespace-name before ';' token

I used compiler option "-std=c++0x" for this new feature.
Reply all
Reply to author
Forward
0 new messages