Der Code für class_c wäre jedoch einfacher zu verstehen und zu verwalten, wenn ein Konstruktor einen Teil der Aufgaben an einen anderen Konstruktor delegieren würde.
Zum Hinzufügen von delegierenden Konstruktoren verwenden Sie die Syntax constructor (. .
.) :
msdn.microsoft.comYou could reduce the repetitive code by adding a function that does all of the validation, but the code for class_c would be easier to understand and maintain if one constructor could delegate some of the work to another one.
To add delegating constructors, use the constructor (. .
.) :
msdn.microsoft.comWenn es mehrere Konstruktoren für eine Klasse gibt, wird der Konstruktor ausgewählt, der der Anzahl der bereitgestellten Argumente am ehesten entspricht.
Wenn kein passender Konstruktor gefunden wird, der den bereitgestellten Argumenten entspricht, wird die Fehlermeldung 'No constructor found' zurückgegeben.
manual.altova.comIf there is more than one constructor for a class, then the constructor that most closely matches the number of arguments supplied is selected.
If no constructor is deemed to match the supplied argument/s, then a 'No constructor found' error is returned.
manual.altova.comAutomatische Erkennung und Auswahl bestimmter GPUs an einem Cluster-Knoten, wenn mehrere GPUs an dem Knoten verfügbar sind
Weitere MATLAB-Funktionen aktiviert für verteilte Arrays, einschließlich sparse constructor bsxfun und repmat
Erkennung über den Profile Manager von MATLAB Distributed Computing Server-Clustern, die für die Verbindung von Anwender-Desktops zur Verfügung stehen
www.mathworks.deAutomatic detection and selection of specific GPUs on a cluster node when multiple GPUs are available on the node
More MATLAB functions enabled for distributed arrays, including sparse constructor, bsxfun, and repmat
Detection of MATLAB Distributed Computing Server clusters that are available for connection from user desktops through Profile Manager
www.mathworks.deChcesz dodać słowo, frazę lub tłumaczenie?
Wyślij nowe hasło.