|
Set 으로 도움말 찾아보시면 나옵니다.
아래 도움말 내용이니 한번 읽어보세요
-----------------------------------------
Set is a template for emulating the intrinsic set types found in Object Pascal.
Header
sysset.h
Description
The Set<type, minval, maxval> is a C++ class template that implements the Delphi intrinsic type set.
Syntax
template<class T, unsigned char minEl, unsigned char maxEl>
class __declspec(delphireturn) Set;
You must specify three template parameters:
Parameter Usage
type the type of the elements (usually int, char, or an enum type)
minval the minimum value the set can hold (this value cannot be less than 0)
maxval the maximum value the set can hold (this value cannot be greater than 255)
Each instantiation of a Set creates an object based on all three parameters. Therefore, the following are two distinct types because they have different minimum and maximum values:
Set <char, 'A', 'C'> s1;
Set <char, 'X', 'Z'> s2;
if (s1 == s2) // ERROR; illegal struct.
To create multiple instances of a Set type, use a typedef expression.
typedef Set <char, 'A','Z'> UPPERCASESet;
The declaration of a Set variable does not initialize the variable. You can declare the set types and initialize them by using the << operator, as shown in this example:
UPPERCASESet s1;
s1 << 'A' << 'B' << 'C'; // Initialize
UPPERCASESet s2;
s2 << 'X' << 'Y' << 'Z'; // Initialize
Note: If you #include <iostream> or #define VCL_IOSTREAM before the include statement for sysset.h (which is typically included indirectly via vcl.h), you can use the streaming operators (<< and >>) with Set values as an argument:
template <class T, unsigned char minEl, unsigned char maxEl> ostream& operator <<(ostream& os, const Set<T, minEl, maxEl> & arg);
template <class T, unsigned char minEl, unsigned char maxEl> istream& operator >> (istream& is, Set<T, minEl, maxEl> & arg)
박살맨 님이 쓰신 글 :
: c++ 빌더를 배워볼려는데요.
:
: 아주 기초적인 질문 하나 올려봅니다.
:
: MessageDlg("안녕하십니까?", mtConfirmation, TMsgDlgButtons() << mbOK << mbCancel, 0);
:
: 여기서
:
: TMsgDlgButtons() << mbOK << mbCancel
:
: 이 부분이 어떤 문법을 사용한 것인지 잘 이해가 안 되네요. << 연산자라면 input 연산자 같긴 한데
:
: 고수님들의 설명 좀 부탁드려 봅니다.
|