C++ - 라이브러리 출력 이름 변경하기

출처 라이브러리 출력 이름을 MyLibrary_x86_Debug.lib 라고 하고 싶다. 또 아래처럼 디렉토리 구성으로 하고 싶다. MyLibrary MyLibrary.sln MyLibrary MyLibrary.vcxproj lib MyLibrary_x86_Debug.lib MyLibrary_x64_Debug.lib MyLibrary_x86_Release.lib MyLibrary_x64_Release.lib 으 프로젝트는 라이브러리를 만드는 것이다. 구성 프로퍼티 -> 일반 출력 디렉토리를 바꾼다. $(SolitionDir)..\lib\ 타겟 이름을 바꾼다. $(SolutionName)_$(Platform)_$(Configuration)...
더 읽기

C++ - PRIVATE 멤버에 합법적으로 접근하기

출처 class Employer{ float time_for_game_;//게임 시간 float time_for_anime_;//애니메이션의 시간 float time_for_family_;//가족과의 시간 public: float time_for_work_;//일의 시간 // 인사 template<class Rank> void greet(Rank target){ std;cout<<"hello"<<std::endl; } }; //사장에게만은 인사 말고 휴가를 조르다 template<> void Employer::greet(President target){ std;cout<<"holiday please"<<std::endl; } int main()...
더 읽기

Linux TCP 서버와 관련된 커널 파라메터 튜닝

출처 커널 파라메터 설명은 아래 링크에서 참고 linux/Documentation/sysctl/ 예를 들어 net 계열의 파라메터 설명을 보고 싶다는 아래에서 확인한다. linux/Documentation/sysctl/net.txt TCP 서버용 tuning 기본 # 항구적 설정 $ vi /etc/sysctl.conf $ sysctl -p kernel # 공유 메모리의 최대 사이즈. 서버 탑재...
더 읽기

C++ - C++11에서 추가된 사이즈 엄밀한 정수 타입

출처 C++11에서 새로 추가됨 int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t, uint32_t, uint64_t, int_fast8_t, int_fast16_t, int_fast32_t, int_fast64_t, uint_fast8_t, uint_fast16_t, uint_fast32_t, uint_fast64_t, int_least8_t, int_least16_t, int_least32_t, int_least64_t, uint_least8_t, uint_least16_t, uint_least32_t, uint_least64_t, intmax_t, uintmax_t, intptr_t, uintptr_t 아래 헤더 파일을 추가해야 한다 #include <cstdint> std::int8_t...
더 읽기

C++ - __if_exists

출처 Visual C++ 전용 키워드 이다. __if_exists ( identifier ) { statements }; identifier에 전달한 식별자가 존재한다면 statements가 실행된다. 부정형으로 __if_not_exists가 있다. 컴파일 타임 때 실행. template<typename T> class X : public T { public: void Dump() { __if_exists(T::Dump) {...
더 읽기

C++ - 추상 기저 클래스

아래 코드처럼 virtual 이 붙은 가상 기반 클래스는 “모호성” 을 피하기 위함이다. class B : virtual public A{} class C : virtual public A{} class D : public B, public C{} 가상 기반 클래스가 아니라면 D 클래스가 생성시에 A 를...
더 읽기