can't find right android-platform for project 

환경변수 ANDROID_NDK_ROOT 로 만들어서 발생한 문제 NDK_ROOT 하면 정상적으로 됨

또는


환경변수 ANDROID SDK ROOT가 안맞거나..


결론 = 환경 변수가 안맞아서 발생하는 에러

Posted by 에브리피플
,

std::function 쓰는이유

c++ 2015. 7. 13. 10:36

 std::function을 사용하는 것은 람다 자체를 함수 인수로 넣을 때나, 람다를 넣을 STL 컨테이너를 만드는 등의 작업을 할 때 쓰일 수 있으니 기억해 주자.

'c++' 카테고리의 다른 글

std::chrono 시간 카운트 계산 초단위  (0) 2016.10.24
C++11 move semantic 관련  (0) 2015.07.12
대각선 이동  (0) 2015.03.19
std::find_if, std::lamda  (0) 2015.02.05
std::function 배열, 벡터  (0) 2015.01.08
Posted by 에브리피플
,

C++11 move semantic 관련

c++ 2015. 7. 12. 17:42

#include "stdafx.h"

#include <string>

#include <iostream>

using namespace std;

class Test

{

static const int size;

private:

char* pData;

public:

Test()

{

cout << "디폴트" << endl;

pData = new char[size];

}

Test(const Test& other)

{

cout << "복사" << endl;

pData = new char[size];

memcpy(pData, other.pData, size);

}

Test(Test&& other)

{

cout << "이동" << endl;

pData = other.pData;

other.pData = nullptr;

Test& operator=(const Test& other)

{

cout << "할당 연산자" << endl;

if (this == &other)

return *this;

delete[] pData;

pData = new char[size];

memcpy(pData, other.pData, size);

return *this;

}

Test& operator=(Test&& other)

{

cout << "이동 할당 연산자" << endl;

if (this == &other)

return *this;

delete[] pData;


pData = other.pData;

other.pData = nullptr;

return *this;

}

~Test()

{

delete[] pData;

}

};


const int Test::size = 100;


int _tmain(int argc, _TCHAR* argv[])

{

Test aaa;

Test bbb = aaa;

aaa = bbb;

aaa = std::move(bbb);

Test ccc = Test(std::move(aaa));

return 0;

}



'c++' 카테고리의 다른 글

std::chrono 시간 카운트 계산 초단위  (0) 2016.10.24
std::function 쓰는이유  (0) 2015.07.13
대각선 이동  (0) 2015.03.19
std::find_if, std::lamda  (0) 2015.02.05
std::function 배열, 벡터  (0) 2015.01.08
Posted by 에브리피플
,