Click here to Skip to main content
14,304,866 members

ATL / WTL / STL

 
Questionuser32!IsWindow crash Pin
yu-jian2-Jun-15 0:42
groupyu-jian2-Jun-15 0:42 
AnswerRe: user32!IsWindow crash Pin
Richard MacCutchan2-Jun-15 5:13
protectorRichard MacCutchan2-Jun-15 5:13 
AnswerRe: user32!IsWindow crash Pin
Bernhard Hiller3-Jun-15 3:14
memberBernhard Hiller3-Jun-15 3:14 
QuestionVS skips $include "stdafx.h" Pin
bkelly131-Jun-15 9:38
memberbkelly131-Jun-15 9:38 
AnswerRe: VS skips $include "stdafx.h" Pin
Richard Andrew x641-Jun-15 12:55
professionalRichard Andrew x641-Jun-15 12:55 
GeneralRe: VS skips $include "stdafx.h" Pin
bkelly131-Jun-15 13:17
memberbkelly131-Jun-15 13:17 
AnswerRe: VS skips $include "stdafx.h" Pin
peterchen12-Aug-15 12:52
memberpeterchen12-Aug-15 12:52 
QuestionC++ 11 std::unique_ptr related compiling error Pin
Falconapollo28-May-15 17:27
memberFalconapollo28-May-15 17:27 
I'm stuck here on how to compile the following code, i need to put a struct which contains std::unique_ptr into std::map, but i always get the error message, anybody can help me?
Quote:
e:\console.cpp(21): error C2248: 'std::unique_ptr<_Ty>::unique_ptr' : cannot access private member declared in class 'std::unique_ptr<_Ty>'
1> with
1> [
1> _Ty=int
1> ]
1> d:\programfiles\vs 2010\vc\include\memory(2347) : see declaration of 'std::unique_ptr<_Ty>::unique_ptr'
1> with
1> [
1> _Ty=int
1> ]
1> This diagnostic occurred in the compiler generated function 'Baa::Baa(const Baa &)'
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.28
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


here is my code:

#include <iostream>
#include <memory>
#include <vector>
#include <map>

struct Baa {
	std::unique_ptr<int> x;

	Baa() {
	}

	Baa(Baa&& o)
	{
		x = std::move(o.x);
	}
	Baa operator = (Baa&& param)
	{
		x = std::move(param.x);
		return *this;
	}
};


int main()
{
	std::map<int, Baa> sheep;
	Baa ba;
	sheep[0] = ba;
}

QuestionRe: C++ 11 std::unique_ptr related compiling error Pin
yufengzjj2-Jun-15 4:19
memberyufengzjj2-Jun-15 4:19 
AnswerRe: C++ 11 std::unique_ptr related compiling error Pin
Theo Buys8-Jul-15 1:34
memberTheo Buys8-Jul-15 1:34 
AnswerRe: C++ 11 std::unique_ptr related compiling error Pin
vickoza10-Jul-15 6:23
membervickoza10-Jul-15 6:23 
QuestionCListBox with wchar or WCHAR, Resolved Pin
bkelly1327-May-15 8:09
memberbkelly1327-May-15 8:09 
AnswerRe: CListBox with wchar or WCHAR Pin
emadns27-May-15 9:39
memberemadns27-May-15 9:39 
AnswerRe: CListBox with wchar or WCHAR Pin
Richard MacCutchan27-May-15 21:10
protectorRichard MacCutchan27-May-15 21:10 
GeneralRe: CListBox with wchar or WCHAR Pin
bkelly1328-May-15 3:40
memberbkelly1328-May-15 3:40 
GeneralRe: CListBox with wchar or WCHAR Pin
Richard MacCutchan28-May-15 3:55
protectorRichard MacCutchan28-May-15 3:55 
GeneralRe: CListBox with wchar or WCHAR, Problem discovered Pin
bkelly1329-May-15 3:57
memberbkelly1329-May-15 3:57 
GeneralRe: CListBox with wchar or WCHAR, Problem discovered Pin
Richard MacCutchan29-May-15 4:33
protectorRichard MacCutchan29-May-15 4:33 
Questionis it true? fells he is boast, please somebody help me test . Pin
1971 powerChina7-May-15 15:19
member1971 powerChina7-May-15 15:19 
QuestionRe: is it true? fells he is boast, please somebody help me test . Pin
ZurdoDev18-May-15 4:54
professionalZurdoDev18-May-15 4:54 
QuestionServer execution failed in MFC COM Pin
Hydera29-Apr-15 23:59
memberHydera29-Apr-15 23:59 
AnswerRe: Server execution failed in MFC COM Pin
achal375418-May-15 22:00
memberachal375418-May-15 22:00 
QuestionCListViewCtrl HitTest problem Pin
ush_28-Apr-15 9:38
memberush_28-Apr-15 9:38 
Questioncannot get text of __DATE__ (resolved) Pin
bkelly1322-Apr-15 9:24
memberbkelly1322-Apr-15 9:24 
AnswerRe: cannot get text of __DATE__ Pin
Richard MacCutchan22-Apr-15 23:19
protectorRichard MacCutchan22-Apr-15 23:19 

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.