int compare(const std::string& s);&
int compare(const std::wstring& s)
{
int c = compare(s.c_str());
return c;
}
int compare(const std::string* s);&
int compare(const std::wstring* s)
{
int c = compare(s->c_str());
return c;
}
/*==============================
접근 오퍼레이터 추론 버전
==============================*/
int compare(const std::string& s);&
int compare(const std::wstring& s);&
int compare(const std::string* s);&
int compare(const std::wstring* s)
{
int c = compare(s.>c_str());
return c;
}
//==============================
이렇게 다중 선언을 만들고 끝에 정의 본문이 나오면
컴파일러에서 자동으로 확장해주는거임
템플릿 한정자에서 지원하는거 보다 훨씬 깔끔하고 간단하게 구현 가능
템플릿 한정자 버전으로 만들 경우 너무 복잡해질거 같아서 생각해봄
어떰?
이런건 처음봅니다
(신기)
흠...
그냥 문자열 래퍼 클래스 정의해서 프로젝트에서 쓰는게 나아보이는데
차라리 그룹타입 같은게 있는게 낫지 않겠음?
처음볼 수 밖에 저런건 없으니까.
C++ 동인지 오졋구요... C91에 부스냅시다
처음 생각한게 템플릿 그룹 타입형인데 그게 구현하려면 너무 힘들거 같고... 저걸 우선적으로 구현해놓으면 완전 편리할거 같아서요 ㅋㅋ
2차 사용자 입장에서 저렇게 유연하게 쓸수 있는건 확실히 나쁘진 않은것같아요
typegrp STRING { CStringA, CStringW }; 이런게 깔끔하지 않음? 캭캭.
ㄴ그것도 괜찮은듯
??
나랑 같은 닉 쓰는 유동이 생겼다..