Click here to Skip to main content
15,897,273 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Data Encapsulation Pin
Richard MacCutchan8-Jun-12 22:07
mveRichard MacCutchan8-Jun-12 22:07 
AnswerRe: Data Encapsulation Pin
Aescleal9-Jun-12 9:40
Aescleal9-Jun-12 9:40 
QuestionMy assignment aggregation, composition and inheritance Pin
David96378-Jun-12 19:23
David96378-Jun-12 19:23 
AnswerRe: My assignment aggregation, composition and inheritance Pin
Richard MacCutchan8-Jun-12 22:02
mveRichard MacCutchan8-Jun-12 22:02 
GeneralRe: My assignment aggregation, composition and inheritance Pin
David96379-Jun-12 0:13
David96379-Jun-12 0:13 
GeneralRe: My assignment aggregation, composition and inheritance Pin
Richard MacCutchan9-Jun-12 0:20
mveRichard MacCutchan9-Jun-12 0:20 
AnswerRe: My assignment aggregation, composition and inheritance Pin
Aescleal9-Jun-12 10:09
Aescleal9-Jun-12 10:09 
QuestionBuild error with Visual C++ 2010 Pin
Falconapollo8-Jun-12 17:10
Falconapollo8-Jun-12 17:10 
I build the following code(copy from MSDN 2008 SP1)
C++
// std_tr1__random__mersenne_twister_construct.cpp 
// compile with: /EHsc 
#include <random> 
#include <iostream> 
 
typedef std::tr1::minstd_rand Myeng; 
typedef std::tr1::mersenne_twister<unsigned int, 32, 624, 
    397, 31, 0x9908b0df, 11, 7, 0x9d2c5680, 
    15, 0xefc60000, 18> Myceng;  // same as mt19937 
int main() 
    { 
    Myeng eng; 
    Myceng ceng; 
    Myceng::result_type compval = ceng(); 
 
    compval = compval;  // to quiet "unused" warnings 
 
    std::cout << "W == " << Myceng::word_size << std::endl; 
    std::cout << "N == " << Myceng::state_size << std::endl; 
    std::cout << "M == " << Myceng::shift_size << std::endl; 
    std::cout << "R == " << Myceng::mask_bits << std::endl; 
    std::cout << "A == " << Myceng::parameter_a << std::endl; 
    std::cout << "U == " << Myceng::output_u << std::endl; 
    std::cout << "S == " << Myceng::output_s << std::endl; 
    std::cout << "B == " << Myceng::output_b << std::endl; 
    std::cout << "T == " << Myceng::output_t << std::endl; 
    std::cout << "C == " << Myceng::output_c << std::endl; 
    std::cout << "L == " << Myceng::output_l << std::endl; 
 
    std::cout << "min == " << ceng.min() << std::endl; 
    std::cout << "max == " << ceng.max() << std::endl; 
 
    ceng.seed(); // reseed base engine 
    std::cout << "a random value == " << ceng() << std::endl; 
    std::cout << "a random value == " << ceng() << std::endl; 
    std::cout << "a random value == " << ceng() << std::endl; 
 
    Myceng ceng2(eng); // construct with generator 
    ceng2.seed(eng);  // seed with generator 
 
    Myceng ceng3(5UL);  // construct with unsigned long seed 
    ceng3.seed(5UL);  // seed with unsigned long 
 
    return (0); 
    } 


with Visual Studio 2010, but the compiler reports errors:
C++
1>------ Build started: Project: Console, Configuration: Debug Win32 ------
1>Build started 2012-6-9 11:05:53.
1>InitializeBuildStatus:
1>  Touching "Debug\Console.unsuccessfulbuild".
1>ClCompile:
1>  Console.cpp
1>  _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
1>z:\e\disk\vc\justtest\console\console.cpp(27): warning C4003: not enough actual parameters for macro 'min'
1>z:\e\disk\vc\justtest\console\console.cpp(27): error C2059: syntax error : '('
1>z:\e\disk\vc\justtest\console\console.cpp(28): error C2039: '<<' : is not a member of 'std::tr1::mersenne_twister<_Ty,_Wx,_Nx,_Mx,_Rx,_Px,_Ux,_Sx,_Bx,_Tx,_Cx,_Lx>'
1>          with
1>          [
1>              _Ty=unsigned int,
1>              _Wx=32,
1>              _Nx=624,
1>              _Mx=397,
1>              _Rx=31,
1>              _Px=-1727483681,
1>              _Ux=11,
1>              _Sx=7,
1>              _Bx=-1658038656,
1>              _Tx=15,
1>              _Cx=-272236544,
1>              _Lx=18
1>          ]
1>z:\e\disk\vc\justtest\console\console.cpp(28): error C2039: 'ceng' : is not a member of 'std::tr1::mersenne_twister<_Ty,_Wx,_Nx,_Mx,_Rx,_Px,_Ux,_Sx,_Bx,_Tx,_Cx,_Lx>'
1>          with
1>          [
1>              _Ty=unsigned int,
1>              _Wx=32,
1>              _Nx=624,
1>              _Mx=397,
1>              _Rx=31,
1>              _Px=-1727483681,
1>              _Ux=11,
1>              _Sx=7,
1>              _Bx=-1658038656,
1>              _Tx=15,
1>              _Cx=-272236544,
1>              _Lx=18
1>          ]
1>z:\e\disk\vc\justtest\console\console.cpp(28): warning C4003: not enough actual parameters for macro 'max'
1>z:\e\disk\vc\justtest\console\console.cpp(28): error C2059: syntax error : '('
1>z:\e\disk\vc\justtest\console\console.cpp(30): error C2039: 'ceng' : is not a member of 'std::tr1::mersenne_twister<_Ty,_Wx,_Nx,_Mx,_Rx,_Px,_Ux,_Sx,_Bx,_Tx,_Cx,_Lx>'
1>          with
1>          [
1>              _Ty=unsigned int,
1>              _Wx=32,
1>              _Nx=624,
1>              _Mx=397,
1>              _Rx=31,
1>              _Px=-1727483681,
1>              _Ux=11,
1>              _Sx=7,
1>              _Bx=-1658038656,
1>              _Tx=15,
1>              _Cx=-272236544,
1>              _Lx=18
1>          ]
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:04.00
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========


Any one can help?
AnswerRe: Build error with Visual C++ 2010 Pin
Richard MacCutchan8-Jun-12 22:53
mveRichard MacCutchan8-Jun-12 22:53 
GeneralRe: Build error with Visual C++ 2010 Pin
Falconapollo8-Jun-12 23:05
Falconapollo8-Jun-12 23:05 
GeneralRe: Build error with Visual C++ 2010 Pin
Richard MacCutchan8-Jun-12 23:29
mveRichard MacCutchan8-Jun-12 23:29 
GeneralRe: Build error with Visual C++ 2010 Pin
Falconapollo8-Jun-12 23:35
Falconapollo8-Jun-12 23:35 
AnswerRe: Build error with Visual C++ 2010 Pin
Stephen Hewitt10-Jun-12 1:17
Stephen Hewitt10-Jun-12 1:17 
QuestionIf CDialog is destroyed is UI CWinThread created While object was alive get destroyed as Well Pin
ForNow8-Jun-12 2:31
ForNow8-Jun-12 2:31 
AnswerRe: If CDialog is destroyed is UI CWinThread created While object was alive get destroyed as Well Pin
«_Superman_»8-Jun-12 2:46
professional«_Superman_»8-Jun-12 2:46 
GeneralRe: If CDialog is destroyed is UI CWinThread created While object was alive get destroyed as Well Pin
ForNow8-Jun-12 10:52
ForNow8-Jun-12 10:52 
GeneralRe: If CDialog is destroyed is UI CWinThread created While object was alive get destroyed as Well Pin
«_Superman_»8-Jun-12 16:11
professional«_Superman_»8-Jun-12 16:11 
AnswerRe: If CDialog is destroyed is UI CWinThread created While object was alive get destroyed as Well Pin
Albert Holguin8-Jun-12 4:33
professionalAlbert Holguin8-Jun-12 4:33 
QuestionCorruption of the heap. Why ? Pin
sdancer757-Jun-12 23:49
sdancer757-Jun-12 23:49 
AnswerRe: Corruption of the heap. Why ? Pin
Rolf Kristensen8-Jun-12 2:01
Rolf Kristensen8-Jun-12 2:01 
GeneralRe: Corruption of the heap. Why ? Pin
Erudite_Eric8-Jun-12 2:35
Erudite_Eric8-Jun-12 2:35 
GeneralRe: Corruption of the heap. Why ? Pin
sdancer758-Jun-12 6:02
sdancer758-Jun-12 6:02 
AnswerRe: Corruption of the heap. Why ? Pin
Aescleal8-Jun-12 3:00
Aescleal8-Jun-12 3:00 
GeneralRe: Corruption of the heap. Why ? Pin
sdancer758-Jun-12 6:03
sdancer758-Jun-12 6:03 
GeneralRe: Corruption of the heap. Why ? Pin
sdancer759-Jun-12 3:43
sdancer759-Jun-12 3:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.