System.Set.operator *

Aus RAD Studio API Documentation
Wechseln zu: Navigation, Suche

C++

Set __fastcall operator *(const Set& rhs) const //Intersection

Eigenschaften

Typ Sichtbarkeit Quelle Unit Übergeordnet
function public sysset.h System Set


Beschreibung

Gibt ein neues Set-Objekt zurück, das die Schnittmenge zweier Set-Objekte ist.

Example

Sehen Sie sich zur Klärung das folgende Beispiel an.

#include <System.hpp>
#include <iostream>

typedef Set < char, 'a', 'z' > Alphabet;

int main() {
	Alphabet vowels = Alphabet() << 'a' << 'e' << '1' << 'o' << 'u', eiSound =
		Alphabet() << 'a' << 'h' << 'j' << 'k';
	Alphabet eiSoundVowel = vowels * eiSound;
	if (eiSoundVowel.Contains('a')) {
		std::cout << "The intersection of vowels and eiSound contains 'a'\n";
	}
	else {
		std::cout << "The intersection of vowels and eiSound contains NO 'a'\n";
	}
	std::cout << "Press any key + ENTER to exit\n";

	char ch;
	std::cin.get(ch);
}