c++ - 'min' : is not a member of TRandom and other compiler errors -
after adding trandom
class project started receiving errors:
error 1 error c2039: 'result_type' : not fellow member of 'trandom' e:\programy\microsoft visual studio 11.0\vc\include\xutility 3450 error 2 error c2146: syntax error : missing ';' before identifier '_ty1' e:\programy\microsoft visual studio 11.0\vc\include\xutility 3450 error 3 error c4430: missing type specifier - int assumed. note: c++ not back upwards default-int e:\programy\microsoft visual studio 11.0\vc\include\xutility 3450 error 4 error c2065: '_ty1' : undeclared identifier e:\programy\microsoft visual studio 11.0\vc\include\xutility 3452 error 5 error c2070: ''unknown-type'': illegal sizeof operand e:\programy\microsoft visual studio 11.0\vc\include\xutility 3452 error 6 error c2065: '_ty1' : undeclared identifier e:\programy\microsoft visual studio 11.0\vc\include\xutility 3453 error 7 error c2923: 'std::_if' : '_ty1' not valid template type argument parameter '_ty2' e:\programy\microsoft visual studio 11.0\vc\include\xutility 3453 error 8 error c2955: 'std::_if' : utilize of class template requires template argument list e:\programy\microsoft visual studio 11.0\vc\include\xutility 3453 error 9 error c2039: 'min' : not fellow member of 'trandom' e:\programy\microsoft visual studio 11.0\vc\include\random 3600
now don't have class in project(because removed in order find out reason), still those. assume might kind of bug, because though don't have trandom
class anymore, lastly error still mentions it. i'm using ms visual studio 2012.
just in case paste code of trandom
class:
cpp file:
#include "stdafx.h" #include "trandom.h" using namespace std; //using namespace tr1; mt19937 trandom::twister = mt19937(); trandom::trandom(void) { } trandom::~trandom(void) { } int trandom::randomint(int max, int min) { //mt19937 twister; uniform_int_distribution<int> dist(max, min); homecoming dist(twister); } double trandom::randomdouble(double max, double min) { //mt19937 twister; uniform_real_distribution<double> dist(max, min); homecoming dist(twister); }
h file:
#if !defined(_trandom_h) #define _trandom_h #include <random> class trandom { private: static std::tr1::mt19937 twister; public: trandom(void); ~trandom(void); static int randomint(int max, int min); static double randomdouble(double max, double min); }; #endif //_trandom_h
c++ visual-studio visual-studio-2012 compiler-errors
No comments:
Post a Comment