Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of MediaWiki\Session\PHPSessionHandler::open($save_path, $session_name) should either be compatible with SessionHandlerInterface::open(string $path, string $name): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/session/PHPSessionHandler.php on line 199

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of MediaWiki\Session\PHPSessionHandler::close() should either be compatible with SessionHandlerInterface::close(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/session/PHPSessionHandler.php on line 214

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of MediaWiki\Session\PHPSessionHandler::read($id) should either be compatible with SessionHandlerInterface::read(string $id): string|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/session/PHPSessionHandler.php on line 228

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of MediaWiki\Session\PHPSessionHandler::write($id, $dataStr) should either be compatible with SessionHandlerInterface::write(string $id, string $data): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/session/PHPSessionHandler.php on line 256

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of MediaWiki\Session\PHPSessionHandler::destroy($id) should either be compatible with SessionHandlerInterface::destroy(string $id): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/session/PHPSessionHandler.php on line 362

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of MediaWiki\Session\PHPSessionHandler::gc($maxlifetime) should either be compatible with SessionHandlerInterface::gc(int $max_lifetime): int|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/session/PHPSessionHandler.php on line 383

Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent in /var/www/cppe.ru/www/includes/session/PHPSessionHandler.php on line 126

Warning: ini_set(): Session ini settings cannot be changed after headers have already been sent in /var/www/cppe.ru/www/includes/session/PHPSessionHandler.php on line 127

Warning: session_cache_limiter(): Session cache limiter cannot be changed after headers have already been sent in /var/www/cppe.ru/www/includes/session/PHPSessionHandler.php on line 133

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Warning: session_set_save_handler(): Session save handler cannot be changed after headers have already been sent in /var/www/cppe.ru/www/includes/session/PHPSessionHandler.php on line 140

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of Wikimedia\Rdbms\IResultWrapper::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/libs/rdbms/database/resultwrapper/IResultWrapper.php on line 70

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of Wikimedia\Rdbms\IResultWrapper::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/libs/rdbms/database/resultwrapper/IResultWrapper.php on line 80

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of Wikimedia\Rdbms\IResultWrapper::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/libs/rdbms/database/resultwrapper/IResultWrapper.php on line 75

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of Wikimedia\Rdbms\ResultWrapper::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/libs/rdbms/database/resultwrapper/ResultWrapper.php on line 117

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of Wikimedia\Rdbms\ResultWrapper::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/libs/rdbms/database/resultwrapper/ResultWrapper.php on line 90

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of MediaWiki\Session\Session::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/session/Session.php on line 624

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of MediaWiki\Session\Session::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/session/Session.php on line 629

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of MediaWiki\Session\Session::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/session/Session.php on line 639

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of MediaWiki\Session\Session::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/session/Session.php on line 634

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of MediaWiki\Session\Session::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/session/Session.php on line 649

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of MediaWiki\Session\Session::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/session/Session.php on line 644

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of MediaWiki\Session\Session::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/session/Session.php on line 659

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of & MediaWiki\Session\Session::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/session/Session.php on line 672

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of MediaWiki\Session\Session::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/session/Session.php on line 681

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Return type of MediaWiki\Session\Session::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/cppe.ru/www/includes/session/Session.php on line 685

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Message implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/cppe.ru/www/includes/Message.php on line 159

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: RawMessage implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in /var/www/cppe.ru/www/includes/RawMessage.php on line 34

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property RequestContext::$recursion is deprecated in /var/www/cppe.ru/www/includes/context/RequestContext.php on line 354

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property Parser::$mPreprocessorClass is deprecated in /var/www/cppe.ru/www/includes/parser/Parser.php on line 280

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property PPDStack::$accum is deprecated in /var/www/cppe.ru/www/includes/parser/Preprocessor_DOM.php on line 803

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Warning: Cannot modify header information - headers already sent by (output started at /var/www/cppe.ru/www/includes/session/PHPSessionHandler.php:34) in /var/www/cppe.ru/www/includes/Feed.php on line 232

Warning: Cannot modify header information - headers already sent by (output started at /var/www/cppe.ru/www/includes/session/PHPSessionHandler.php:34) in /var/www/cppe.ru/www/includes/Feed.php on line 237

Warning: Cannot modify header information - headers already sent by (output started at /var/www/cppe.ru/www/includes/session/PHPSessionHandler.php:34) in /var/www/cppe.ru/www/includes/WebResponse.php on line 46

Warning: Cannot modify header information - headers already sent by (output started at /var/www/cppe.ru/www/includes/session/PHPSessionHandler.php:34) in /var/www/cppe.ru/www/includes/WebResponse.php on line 46

Warning: Cannot modify header information - headers already sent by (output started at /var/www/cppe.ru/www/includes/session/PHPSessionHandler.php:34) in /var/www/cppe.ru/www/includes/WebResponse.php on line 46

Warning: Cannot modify header information - headers already sent by (output started at /var/www/cppe.ru/www/includes/session/PHPSessionHandler.php:34) in /var/www/cppe.ru/www/includes/WebResponse.php on line 46

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48
http://cppe.ru/index.php?action=history&feed=atom&title=C%2B%2B%2FClass%2Ftemplate_class
C++/Class/template class - История изменений 2026-11-08T04:25:04Z История изменений этой страницы в вики MediaWiki 1.30.0
Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property WikitextContent::$mText is deprecated in /var/www/cppe.ru/www/includes/content/TextContent.php on line 56

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property WikitextContent::$mText is deprecated in /var/www/cppe.ru/www/includes/content/TextContent.php on line 56

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property PoolCounterWorkViaCallback::$poolCounter is deprecated in /var/www/cppe.ru/www/includes/poolcounter/PoolCounterWork.php on line 39

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property PPDStack::$accum is deprecated in /var/www/cppe.ru/www/includes/parser/Preprocessor_DOM.php on line 803

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property PPDStack::$accum is deprecated in /var/www/cppe.ru/www/includes/parser/Preprocessor_DOM.php on line 803

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property BlockLevelPass::$lineStart is deprecated in /var/www/cppe.ru/www/includes/parser/BlockLevelPass.php on line 60

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48
http://cppe.ru/index.php?title=C%2B%2B/Class/template_class&diff=1356&oldid=prev
в 14:21, 25 мая 2010 2010-05-25T14:21:06Z <p></p> <table class="diff diff-contentalign-left" data-mw="interface"> <tr style="vertical-align: top;" lang="ru"> <td colspan="1" style="background-color: white; color:black; text-align: center;">← Предыдущая</td> <td colspan="1" style="background-color: white; color:black; text-align: center;">Версия 14:21, 25 мая 2010</td> </tr><tr><td colspan="2" style="text-align: center;" lang="ru"><div class="mw-diff-empty">(нет различий)</div> </td></tr></table>

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property WikitextContent::$mText is deprecated in /var/www/cppe.ru/www/includes/content/TextContent.php on line 56

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48
http://cppe.ru/index.php?title=C%2B%2B/Class/template_class&diff=1357&oldid=prev
Admin: 1 версия:&#32;Импорт контента... 2010-05-25T10:25:41Z <p>1 версия: Импорт контента...</p> <p><b>Новая страница</b></p><div>==A generic safe-array class that prevents array boundary errors.==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> #include &lt;iostream&gt;<br /> #include &lt;new&gt;<br /> #include &lt;cstdlib&gt;<br /> using namespace std;<br /> template &lt;class T, int len&gt; class dyn_safe_array {<br /> T *aptr; <br /> int length;<br /> public:<br /> dyn_safe_array();<br /> // copy constructor.<br /> dyn_safe_array(const dyn_safe_array &amp;obj);<br /> // Release the allocated memory when a dyn_safe_array object goes out of scope.<br /> ~dyn_safe_array() {<br /> delete [] aptr;<br /> }<br /> // Overload assignment.<br /> dyn_safe_array &amp;operator=(const dyn_safe_array&lt;T,len&gt; &amp;rh_op);<br /> // Use the subscripting operator to access elements in the safe array.<br /> T &amp;operator[](int i);<br /> <br /> // Return the size of the array.<br /> int getlen() { return length; }<br /> };<br /> // constructor.<br /> template &lt;class T, int len&gt;<br /> dyn_safe_array&lt;T, len&gt;::dyn_safe_array() {<br /> try {<br /> aptr = new T[len];<br /> } catch(bad_alloc ba) {<br /> cout &lt;&lt; &quot;Can&quot;t allocate array.\n&quot;;<br /> // Take appropriate action here. This is just<br /> // a placeholder response.<br /> exit(1);<br /> }<br /> // Initialize the array elements to their default value.<br /> for(int i=0; i &lt; len; ++i) aptr[i] = T();<br /> length = len;<br /> }<br /> // copy constructor.<br /> template &lt;class T, int len&gt;<br /> dyn_safe_array&lt;T, len&gt;::dyn_safe_array(const dyn_safe_array &amp;obj) {<br /> cout &lt;&lt; &quot;Using dyn_safe_array&quot;s copy constructor to make a copy.\n&quot;;<br /> try {<br /> aptr = new T[obj.length];<br /> } catch(bad_alloc ba) {<br /> cout &lt;&lt; &quot;Can&quot;t allocate array.\n&quot;;<br /> exit(1);<br /> }<br /> length = obj.length;<br /> // Copy contents of the array.<br /> for(int i=0; i &lt; length; ++i)<br /> aptr[i] = obj.aptr[i];<br /> }<br /> // Overload assignment so that a copy of the array is made.<br /> // The copy is stored in an allocated memory that is separate<br /> // from that used by the right-hand operand.<br /> template&lt;class T, int len&gt; dyn_safe_array&lt;T, len&gt; &amp;<br /> dyn_safe_array&lt;T, len&gt;::operator=(const dyn_safe_array&lt;T, len&gt; &amp;rh_op) {<br /> // If necessary, release the memory currently used by the object.<br /> if(aptr &amp;&amp; (length != rh_op.length)) {<br /> // Delete the previously allocated memory.<br /> delete aptr;<br /> try {<br /> // Allocate an array of the same size as the one used by rh_op.<br /> aptr = new T[rh_op.length];<br /> } catch(bad_alloc ba) {<br /> // Take appropriate action here. This is just a placeholder response.<br /> cout &lt;&lt; &quot;Can&quot;t allocate array.\n&quot;;<br /> exit(1);<br /> }<br /> }<br /> length = rh_op.length;<br /> // Copy contents of the array.<br /> for(int i=0; i &lt; length; ++i)<br /> aptr[i] = rh_op.aptr[i];<br /> return *this;<br /> }<br /> template &lt;class T, int len&gt; T &amp;dyn_safe_array&lt;T, len&gt;::operator[](int i)<br /> {<br /> if(i &lt; 0 || i &gt; length) {<br /> cout &lt;&lt; &quot;\nIndex value of &quot; &lt;&lt; i &lt;&lt; &quot; is out-of-bounds.\n&quot;;<br /> exit(1);<br /> }<br /> return aptr[i];<br /> }<br /> template &lt;class T, int len&gt;<br /> dyn_safe_array&lt;T, len&gt; f(dyn_safe_array&lt;T, len&gt; x) {<br /> cout &lt;&lt; &quot;f() is returning a copy of x.\n&quot;;<br /> return x;<br /> }<br /> class myclass {<br /> public:<br /> int x;<br /> myclass(int i) { x = i; };<br /> myclass() { x = -1; }<br /> };<br /> int main()<br /> {<br /> // Use the integer array.<br /> dyn_safe_array&lt;int, 5&gt; i_ar;<br /> for(int i=0; i &lt; i_ar.getlen(); ++i) i_ar[i] = i;<br /> cout &lt;&lt; &quot;Contents of i_ar: &quot;;<br /> for(int i=0; i &lt; i_ar.getlen(); ++i) cout &lt;&lt; i_ar[i] &lt;&lt; &quot; &quot;;<br /> cout &lt;&lt; &quot;\n\n&quot;;<br /> dyn_safe_array&lt;int, 5&gt; i_ar2 = i_ar;<br /> for(int i=0; i &lt; i_ar2.getlen(); ++i) cout &lt;&lt; i_ar2[i] &lt;&lt; &quot; &quot;;<br /> dyn_safe_array&lt;int, 5&gt; i_ar3;<br /> for(int i=0; i &lt; i_ar3.getlen(); ++i) cout &lt;&lt; i_ar3[i] &lt;&lt; &quot; &quot;;<br /> cout &lt;&lt;&quot;\n\n&quot;;<br /> i_ar3 = f(i_ar);<br /> for(int i=0; i &lt; i_ar3.getlen(); ++i) cout &lt;&lt; i_ar3[i] &lt;&lt; &quot; &quot;;<br /> cout &lt;&lt; &quot;\n\n&quot;;<br /> dyn_safe_array&lt;myclass, 3&gt; mc_ar;<br /> cout &lt;&lt; &quot;Original contents of mc_ar: &quot;;<br /> for(int i=0; i &lt; mc_ar.getlen(); ++i) cout &lt;&lt; mc_ar[i].x &lt;&lt; &quot; &quot;;<br /> cout &lt;&lt; endl;<br /> mc_ar[0].x = 9;<br /> mc_ar[1].x = 8;<br /> mc_ar[2].x = 7;<br /> for(int i=0; i &lt; mc_ar.getlen(); ++i) cout &lt;&lt; mc_ar[i].x &lt;&lt; &quot; &quot;;<br /> cout &lt;&lt; &quot;\n\n&quot;;<br /> cout &lt;&lt; &quot; mc_ar2 = f(mc_ar);\n\n&quot;;<br /> dyn_safe_array&lt;myclass, 3&gt; mc_ar2;<br /> mc_ar2 = f(mc_ar);<br /> cout &lt;&lt; &quot;Contents of mc_ar2 after receiving f(mc_ar): &quot;;<br /> for(int i=0; i &lt; mc_ar2.getlen(); ++i) cout &lt;&lt; mc_ar2[i].x &lt;&lt; &quot; &quot;;<br /> cout &lt;&lt; endl;<br /> return 0;<br /> }<br /> <br /> <br /> &lt;/source&gt;<br /> <br /> <br /> ==An Example with Two Generic Data Types==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> #include &lt;iostream&gt;<br /> using namespace std;<br /> <br /> template &lt;class Type1, class Type2&gt; class myclass<br /> {<br /> Type1 i;<br /> Type2 j;<br /> public:<br /> myclass(Type1 a, Type2 b) { i = a; j = b; }<br /> void show() { cout &lt;&lt; i &lt;&lt; &quot; &quot; &lt;&lt; j &lt;&lt; &quot;\n&quot;; }<br /> };<br /> <br /> int main()<br /> {<br /> myclass&lt;int, double&gt; ob1(10, 0.23);<br /> myclass&lt;char, char *&gt; ob2(&quot;X&quot;, &quot;Templates add power.&quot;);<br /> <br /> ob1.show(); <br /> ob2.show(); <br /> <br /> return 0;<br /> }<br /> <br /> <br /> <br /> &lt;/source&gt;<br /> <br /> <br /> ==Applying Template Classes: A Generic Array Class==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> #include &lt;iostream&gt;<br /> #include &lt;cstdlib&gt;<br /> using namespace std;<br /> <br /> const int SIZE = 10;<br /> <br /> template &lt;class T&gt; class MyClass {<br /> T a[SIZE];<br /> public:<br /> MyClass() {<br /> register int i;<br /> for(i=0; i&lt;SIZE; i++) a[i] = i;<br /> }<br /> T &amp;operator[](int i);<br /> };<br /> <br /> template &lt;class T&gt; T &amp;MyClass&lt;T&gt;::operator[](int i)<br /> {<br /> if(i&lt;0 || i&gt; SIZE-1) {<br /> cout &lt;&lt; &quot;\nIndex value of &quot;;<br /> cout &lt;&lt; i &lt;&lt; &quot; is out-of-bounds.\n&quot;;<br /> exit(1);<br /> }<br /> return a[i];<br /> }<br /> <br /> int main()<br /> {<br /> MyClass&lt;int&gt; intob; // integer array<br /> MyClass&lt;double&gt; doubleob; // double array<br /> <br /> for(int i=0; i&lt;SIZE; i++) intob[i] = i;<br /> for(int i=0; i&lt;SIZE; i++) cout &lt;&lt; intob[i] &lt;&lt; endl;<br /> <br /> for(int i=0; i&lt;SIZE; i++) doubleob[i] = (double) i/3;<br /> for(int i=0; i&lt;SIZE; i++) cout &lt;&lt; doubleob[i] &lt;&lt; endl;<br /> <br /> return 0;<br /> }<br /> <br /> <br /> <br /> &lt;/source&gt;<br /> <br /> <br /> ==Demonstrate a very simple safe pointer class.==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> #include &lt;iostream&gt;<br /> #include &lt;string&gt;<br /> using namespace std;<br /> // The exception type thrown by the safe pointer.<br /> class bad_ptr {<br /> public:<br /> string msg;<br /> bad_ptr(string str) { msg = str; }<br /> };<br /> // A class used to demonstrate the safe pointer.<br /> class myclass {<br /> public:<br /> int alpha;<br /> int beta;<br /> myclass(int p, int q) { alpha = p; beta = q; }<br /> };<br /> template &lt;class T&gt; class safe_ptr {<br /> T *ptr;<br /> public:<br /> safe_ptr() { ptr = 0; }<br /> T *operator-&gt;() {<br /> if(!ptr != 0) throw bad_ptr(&quot;Attempt to use -&gt; on null pointer.&quot;);<br /> else return ptr;<br /> }<br /> T &amp;operator*() {<br /> if(!ptr) throw bad_ptr(&quot;Attempt to dereference null pointer.&quot;);<br /> else return *ptr;<br /> }<br /> operator T *() { return ptr; }<br /> T *operator=(T *val) { ptr = val; return ptr; }<br /> };<br /> int main()<br /> {<br /> safe_ptr&lt;int&gt; intptr;<br /> try {<br /> *intptr = 23;<br /> cout &lt;&lt; &quot;The value pointed to by intptr is: &quot; &lt;&lt; *intptr &lt;&lt; endl;<br /> } catch(bad_ptr bp) {<br /> cout &lt;&lt; bp.msg &lt;&lt; endl;<br /> }<br /> intptr = new int;<br /> try {<br /> *intptr = 23;<br /> cout &lt;&lt; &quot;The value pointed to by intpr is: &quot; &lt;&lt; *intptr &lt;&lt; &quot;\n\n&quot;;<br /> } catch(bad_ptr bp) {<br /> cout &lt;&lt; bp.msg &lt;&lt; endl;<br /> }<br /> safe_ptr&lt;myclass&gt; mcptr;<br /> try {<br /> mcptr = new myclass(100, 200);<br /> cout &lt;&lt; &quot;The values of alpha and beta for mcptr are: &quot;<br /> &lt;&lt; mcptr-&gt;alpha &lt;&lt; &quot; and &quot; &lt;&lt; mcptr-&gt;beta &lt;&lt; endl;<br /> mcptr-&gt;alpha = 27;<br /> cout &lt;&lt; &quot;New value for mcptr-&gt;alpha: &quot; &lt;&lt; mcptr-&gt;alpha &lt;&lt; endl;<br /> cout &lt;&lt; &quot;Same as (*mcptr).alpha: &quot; &lt;&lt; (*mcptr).alpha &lt;&lt; endl;<br /> mcptr-&gt;beta = 99;<br /> cout &lt;&lt; &quot;New value for mcptr-&gt;beta: &quot; &lt;&lt; mcptr-&gt;beta &lt;&lt; &quot;\n\n&quot;;<br /> } catch(bad_ptr bp) {<br /> cout &lt;&lt; bp.msg &lt;&lt; endl;<br /> }<br /> safe_ptr&lt;myclass&gt; mcptr2;<br /> try {<br /> mcptr2-&gt;alpha = 88;<br /> } catch(bad_ptr bp) {<br /> cout &lt;&lt; bp.msg &lt;&lt; endl;<br /> }<br /> delete intptr;<br /> delete mcptr;<br /> return 0;<br /> }<br /> <br /> <br /> &lt;/source&gt;<br /> <br /> <br /> ==Explicit Class Specializations for generic template class==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> #include &lt;iostream&gt;<br /> using namespace std;<br /> <br /> template &lt;class T&gt; class myclass {<br /> T x;<br /> public:<br /> myclass(T a) {<br /> cout &lt;&lt; &quot;Inside generic myclass\n&quot;;<br /> x = a;<br /> }<br /> T getx() { return x; }<br /> };<br /> <br /> template &lt;&gt; class myclass&lt;int&gt; {<br /> int x;<br /> public:<br /> myclass(int a) {<br /> cout &lt;&lt; &quot;Inside myclass&lt;int&gt; specialization\n&quot;;<br /> x = a * a;<br /> }<br /> int getx() { return x; }<br /> };<br /> <br /> int main()<br /> {<br /> myclass&lt;double&gt; d(10.1);<br /> cout &lt;&lt; &quot;double: &quot; &lt;&lt; d.getx() &lt;&lt; &quot;\n\n&quot;;<br /> <br /> myclass&lt;int&gt; i(5);<br /> cout &lt;&lt; &quot;int: &quot; &lt;&lt; i.getx() &lt;&lt; &quot;\n&quot;;<br /> <br /> return 0;<br /> }<br /> <br /> <br /> <br /> &lt;/source&gt;<br /> <br /> <br /> ==Generic Classes: demonstrates a generic stack.==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> #include &lt;iostream&gt;<br /> using namespace std;<br /> <br /> const int SIZE = 10;<br /> <br /> template &lt;class StackType&gt; class stack {<br /> StackType stck[SIZE]; <br /> int tos; <br /> <br /> public:<br /> stack() { tos = 0; } <br /> void push(StackType ob); <br /> StackType pop(); <br /> };<br /> template &lt;class StackType&gt; void stack&lt;StackType&gt;::push(StackType ob)<br /> {<br /> if(tos==SIZE) {<br /> cout &lt;&lt; &quot;Stack is full.\n&quot;;<br /> return;<br /> }<br /> stck[tos] = ob;<br /> tos++;<br /> }<br /> template &lt;class StackType&gt; StackType stack&lt;StackType&gt;::pop()<br /> {<br /> if(tos==0) {<br /> cout &lt;&lt; &quot;Stack is empty.\n&quot;;<br /> return 0; // return null on empty stack<br /> }<br /> tos--;<br /> return stck[tos];<br /> }<br /> <br /> int main()<br /> {<br /> stack&lt;char&gt; s1, s2;<br /> <br /> s1.push(&quot;a&quot;);<br /> s2.push(&quot;x&quot;);<br /> s1.push(&quot;b&quot;);<br /> s2.push(&quot;y&quot;);<br /> s1.push(&quot;c&quot;);<br /> s2.push(&quot;z&quot;);<br /> <br /> for(int i=0; i&lt;3; i++) cout &lt;&lt; &quot;Pop s1: &quot; &lt;&lt; s1.pop() &lt;&lt; &quot;\n&quot;;<br /> for(int i=0; i&lt;3; i++) cout &lt;&lt; &quot;Pop s2: &quot; &lt;&lt; s2.pop() &lt;&lt; &quot;\n&quot;;<br /> <br /> stack&lt;double&gt; ds1, ds2;<br /> <br /> ds1.push(1.1);<br /> ds2.push(2.2);<br /> ds1.push(3.3);<br /> ds2.push(4.4);<br /> ds1.push(5.5);<br /> ds2.push(6.6);<br /> <br /> for(int i=0; i&lt;3; i++) cout &lt;&lt; &quot;Pop ds1: &quot; &lt;&lt; ds1.pop() &lt;&lt; &quot;\n&quot;;<br /> for(int i=0; i&lt;3; i++) cout &lt;&lt; &quot;Pop ds2: &quot; &lt;&lt; ds2.pop() &lt;&lt; &quot;\n&quot;;<br /> <br /> return 0;<br /> }<br /> <br /> <br /> <br /> &lt;/source&gt;<br /> <br /> <br /> ==generic stack template class==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> #include &lt;iostream&gt;<br /> using namespace std;<br /> const int SIZE = 100;<br /> template &lt;class SType&gt; class stack {<br /> SType stck[SIZE];<br /> int tos;<br /> public:<br /> stack(void);<br /> ~stack(void);<br /> void push(SType i);<br /> SType pop(void);<br /> };<br /> template &lt;class SType&gt; stack&lt;SType&gt;::stack()<br /> {<br /> tos = 0;<br /> cout &lt;&lt; &quot;Stack Initialized.&quot; &lt;&lt; endl;<br /> }<br /> template &lt;class SType&gt; stack&lt;SType&gt;::~stack()<br /> {<br /> cout &lt;&lt; &quot;Stack Destroyed.&quot; &lt;&lt; endl;<br /> }<br /> template &lt;class SType&gt; void stack&lt;SType&gt;::push(SType i)<br /> {<br /> if(tos==SIZE)<br /> {<br /> cout &lt;&lt; &quot;Stack is full.&quot; &lt;&lt; endl;<br /> return;<br /> }<br /> stck[tos++] = i;<br /> }<br /> template &lt;class SType&gt; SType stack&lt;SType&gt;::pop(void)<br /> {<br /> if(tos==0)<br /> {<br /> cout &lt;&lt; &quot;Stack underflow.&quot; &lt;&lt; endl;<br /> return 0;<br /> }<br /> return stck[--tos];<br /> }<br /> int main(void)<br /> {<br /> stack&lt;int&gt; a;<br /> stack&lt;double&gt; b;<br /> stack&lt;char&gt; c;<br /> int i;<br /> a.push(1);<br /> a.push(2);<br /> b.push(99.3);<br /> b.push(-12.23);<br /> cout &lt;&lt; a.pop() &lt;&lt; &quot; &quot;;<br /> cout &lt;&lt; a.pop() &lt;&lt; &quot; &quot;;<br /> cout &lt;&lt; b.pop() &lt;&lt; &quot; &quot;;<br /> cout &lt;&lt; b.pop() &lt;&lt; endl;<br /> for(i=0; i&lt;10; i++)<br /> c.push((char) &quot;A&quot; + i);<br /> for(i=0; i&lt;10; i++)<br /> cout &lt;&lt; c.pop();<br /> cout &lt;&lt; endl;<br /> }<br /> <br /> <br /> &lt;/source&gt;<br /> <br /> <br /> ==Get storage off stack for array==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> #include &lt;iostream&gt;<br /> using namespace std;<br /> template &lt;class T, int n&gt;<br /> class assign_array {<br /> public:<br /> T a[n];<br /> };<br /> int main()<br /> {<br /> assign_array&lt;double, 50&gt; x, y;<br /> for (int i = 0; i &lt; 50; ++i)<br /> x.a[i] = i;<br /> for (int i = 0; i &lt; 50; ++i)<br /> y.a[i] = i * 2;<br /> for (int i = 0; i &lt; 50; ++i)<br /> cout &lt;&lt; x.a[i] &lt;&lt; &quot;\t&quot;;<br /> for (int i = 0; i &lt; 50; ++i)<br /> cout &lt;&lt; y.a[i] &lt;&lt; &quot;\t&quot;;<br /> x = y; //should work efficiently<br /> for (int i = 0; i &lt; 50; ++i)<br /> cout &lt;&lt; x.a[i] &lt;&lt; &quot;\t&quot;;<br /> }<br /> <br /> <br /> &lt;/source&gt;<br /> <br /> <br /> ==Passing by reference and using virtual functions in exceptions.==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> #include &lt;iostream&gt;<br /> using namespace std;<br /> const int DefaultSize = 10;<br /> class Array<br /> {<br /> public:<br /> Array(int itsSize = DefaultSize);<br /> Array(const Array &amp;rhs);<br /> ~Array() { delete [] pType;}<br /> Array&amp; operator=(const Array&amp;);<br /> int&amp; operator[](int offSet);<br /> const int&amp; operator[](int offSet) const;<br /> int GetitsSize() const { return itsSize; }<br /> friend ostream&amp; operator&lt;&lt; (ostream&amp;, const Array&amp;);<br /> class xBoundary {};<br /> class xSize<br /> {<br /> public:<br /> xSize(int size):itsSize(size) {}<br /> ~xSize(){}<br /> virtual int GetSize() { return itsSize; }<br /> virtual void PrintError() <br /> { <br /> cout &lt;&lt; &quot;Size error. Received: &quot;;<br /> cout &lt;&lt; itsSize &lt;&lt; endl; <br /> }<br /> protected:<br /> int itsSize;<br /> };<br /> class xTooBig : public xSize<br /> {<br /> public:<br /> xTooBig(int size):xSize(size){}<br /> virtual void PrintError() <br /> { <br /> cout &lt;&lt; &quot;Too big! Received: &quot;;<br /> cout &lt;&lt; xSize::itsSize &lt;&lt; endl; <br /> }<br /> };<br /> class xTooSmall : public xSize<br /> {<br /> public:<br /> xTooSmall(int size):xSize(size){}<br /> virtual void PrintError() <br /> { <br /> cout &lt;&lt; &quot;Too small! Received: &quot;;<br /> cout &lt;&lt; xSize::itsSize &lt;&lt; endl; <br /> }<br /> };<br /> class xZero : public xTooSmall<br /> {<br /> public:<br /> xZero(int size):xTooSmall(size){}<br /> virtual void PrintError() <br /> { <br /> cout &lt;&lt; &quot;Zero!!. Received: &quot; ;<br /> cout &lt;&lt; xSize::itsSize &lt;&lt; endl; <br /> }<br /> };<br /> class xNegative : public xSize<br /> {<br /> public:<br /> xNegative(int size):xSize(size){}<br /> virtual void PrintError() <br /> { <br /> cout &lt;&lt; &quot;Negative! Received: &quot;;<br /> cout &lt;&lt; xSize::itsSize &lt;&lt; endl; <br /> }<br /> };<br /> private:<br /> int *pType;<br /> int itsSize;<br /> };<br /> Array::Array(int size):<br /> itsSize(size)<br /> {<br /> if (size == 0)<br /> throw xZero(size);<br /> if (size &gt; 30000)<br /> throw xTooBig(size);<br /> if (size &lt;1)<br /> throw xNegative(size);<br /> if (size &lt; 10)<br /> throw xTooSmall(size);<br /> pType = new int[size];<br /> for (int i = 0; i&lt;size; i++)<br /> pType[i] = 0;<br /> }<br /> int&amp; Array::operator[] (int offSet)<br /> {<br /> int size = GetitsSize();<br /> if (offSet &gt;= 0 &amp;&amp; offSet &lt; GetitsSize())<br /> return pType[offSet];<br /> throw xBoundary();<br /> return pType[0];<br /> }<br /> const int&amp; Array::operator[] (int offSet) const<br /> {<br /> int size = GetitsSize();<br /> if (offSet &gt;= 0 &amp;&amp; offSet &lt; GetitsSize())<br /> return pType[offSet];<br /> throw xBoundary();<br /> return pType[0];<br /> }<br /> int main()<br /> {<br /> try<br /> {<br /> Array intArray(9);<br /> for (int j = 0; j&lt; 100; j++)<br /> {<br /> intArray[j] = j;<br /> cout &lt;&lt; &quot;intArray[&quot; &lt;&lt; j &lt;&lt; &quot;] okay...\n&quot;;<br /> }<br /> }<br /> catch (Array::xBoundary)<br /> {<br /> cout &lt;&lt; &quot;Unable to process your input!\n&quot;;<br /> }<br /> catch (Array::xSize&amp; theException)<br /> {<br /> theException.PrintError();<br /> }<br /> catch (...)<br /> {<br /> cout &lt;&lt; &quot;Something went wrong!\n&quot;;<br /> }<br /> cout &lt;&lt; &quot;Done.\n&quot;;<br /> return 0;<br /> }<br /> <br /> <br /> &lt;/source&gt;<br /> <br /> <br /> ==sequence template==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> #include &lt;iostream&gt;<br /> using namespace std;<br /> template &lt;class T, int N&gt;<br /> class sequence {<br /> T memblock [N];<br /> public:<br /> void setmember (int x, T value);<br /> T getmember (int x);<br /> };<br /> template &lt;class T, int N&gt;<br /> void sequence&lt;T,N&gt;::setmember (int x, T value) {<br /> memblock[x]=value;<br /> }<br /> template &lt;class T, int N&gt;<br /> T sequence&lt;T,N&gt;::getmember (int x) {<br /> return memblock[x];<br /> }<br /> int main () {<br /> sequence &lt;int,5&gt; myints;<br /> sequence &lt;double,5&gt; myfloats;<br /> myints.setmember (0,100);<br /> myfloats.setmember (3,3.1416);<br /> cout &lt;&lt; myints.getmember(0) &lt;&lt; &quot;\n&quot;;<br /> cout &lt;&lt; myfloats.getmember(3) &lt;&lt; &quot;\n&quot;;<br /> return 0;<br /> }<br /> <br /> <br /> &lt;/source&gt;<br /> <br /> <br /> ==template class with generic parameter==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> #include &lt;iostream&gt;<br /> using namespace std;<br /> template&lt;class T&gt; class Distance {<br /> public:<br /> Distance(T distance); <br /> void show_distance(void) { <br /> cout &lt;&lt; &quot;The distance is &quot; &lt;&lt; distance &lt;&lt; &quot; miles\n&quot;; <br /> };<br /> private:<br /> T distance;<br /> };<br /> template&lt;class T&gt;<br /> Distance&lt;T&gt;::Distance(T distance) { Distance::distance = distance; };<br /> int main(void)<br /> {<br /> Distance&lt;int&gt; short_distance(100);<br /> Distance&lt;long&gt; long_distance(2000000L);<br /> short_distance.show_distance();<br /> long_distance.show_distance();<br /> }<br /> <br /> <br /> &lt;/source&gt;<br /> <br /> <br /> ==template class with two generic parameters==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> #include &lt;iostream&gt;<br /> using namespace std;<br /> template &lt;class T1, class T2&gt; class two_gen {<br /> T1 i;<br /> T2 j;<br /> public:<br /> two_gen(T1 a, T2 b)<br /> { i=a; j=b;}<br /> void show(void)<br /> { cout &lt;&lt; i &lt;&lt; &quot; &quot; &lt;&lt; j &lt;&lt; endl; }<br /> };<br /> int main(void)<br /> {<br /> two_gen&lt;int, double&gt; obj1(10, 0.23);<br /> two_gen&lt;char, char *&gt; obj2(&quot;X&quot;, &quot;This is a test.&quot;);<br /> obj1.show();<br /> obj2.show();<br /> }<br /> <br /> <br /> &lt;/source&gt;<br /> <br /> <br /> ==template class with type parameter==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> #include &lt;iostream&gt;<br /> #include &lt;stdlib.h&gt;<br /> using namespace std;<br /> const int SIZE = 10;<br /> template &lt;class T&gt; class MyClass {<br /> T a[SIZE];<br /> public:<br /> MyClass(void)<br /> {<br /> int i;<br /> for(i=0; i&lt;SIZE; i++)<br /> a[i] = i;<br /> }<br /> T &amp;operator[](int i);<br /> };<br /> template &lt;class T&gt; T &amp;MyClass&lt;T&gt;::operator[](int i)<br /> {<br /> if(i&lt;0 || i&gt; SIZE-1)<br /> {<br /> cout &lt;&lt; endl &lt;&lt; &quot;Index value of &quot;;<br /> cout &lt;&lt; i &lt;&lt; &quot; is out of bounds.&quot; &lt;&lt; endl;<br /> }<br /> return a[i];<br /> }<br /> int main(void)<br /> {<br /> MyClass&lt;int&gt; int_array;<br /> MyClass&lt;double&gt; double_array;<br /> int i;<br /> cout &lt;&lt; &quot;Integer array: &quot;;<br /> for(i=0; i&lt;SIZE; i++)<br /> int_array[i] = i;<br /> for(i=0; i&lt;SIZE; i++)<br /> cout &lt;&lt; int_array[i] &lt;&lt; &quot; &quot;;<br /> cout &lt;&lt; endl;<br /> cout &lt;&lt; &quot;Double array: &quot;;<br /> cout.precision(2);<br /> for(i=0; i&lt;SIZE; i++)<br /> double_array[i] = (double)i/3;<br /> for(i=0; i&lt;SIZE; i++)<br /> cout &lt;&lt; double_array[i] &lt;&lt; &quot; &quot;;<br /> cout &lt;&lt; endl;<br /> int_array[12] = 100; // Calls overloaded array operator<br /> }<br /> <br /> <br /> &lt;/source&gt;<br /> <br /> <br /> ==template extending==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> template &lt;typename T&gt;<br /> class SimpleTemplate<br /> {<br /> public:<br /> SimpleTemplate(T &amp;inObject);<br /> const T&amp; get();<br /> void set(T&amp; inObject);<br /> protected:<br /> T&amp; mObject;<br /> };<br /> template &lt;typename T&gt;<br /> SimpleTemplate&lt;T&gt;::SimpleTemplate(T &amp;inObject) : mObject(inObject)<br /> {<br /> }<br /> template &lt;typename T&gt;<br /> const T&amp; SimpleTemplate&lt;T&gt;::get()<br /> {<br /> return mObject;<br /> }<br /> template &lt;typename T&gt;<br /> void SimpleTemplate&lt;T&gt;::set(T&amp; inObject)<br /> {<br /> mObject = inObject;<br /> }<br /> #include &lt;iostream&gt;<br /> #include &lt;string&gt;<br /> using namespace std;<br /> int main(int argc, char** argv)<br /> {<br /> int i = 7;<br /> SimpleTemplate&lt;int&gt; intWrapper(i);<br /> i = 2;<br /> cout &lt;&lt; &quot;wrapper value is &quot; &lt;&lt; intWrapper.get() &lt;&lt; endl;<br /> string str = &quot;test&quot;;<br /> SimpleTemplate&lt;string&gt; stringWrapper(str);<br /> str += &quot;!&quot;;<br /> cout &lt;&lt; &quot;wrapper value is &quot; &lt;&lt; stringWrapper.get() &lt;&lt; endl;<br /> }<br /> <br /> <br /> &lt;/source&gt;<br /> <br /> <br /> ==Template Version of Generic binary sorted Tree.==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> #include &lt;iostream&gt;<br /> #include &lt;string.h&gt;<br /> using namespace std;<br /> //A generic binary sorted tree.<br /> template &lt;class T&gt; class gen_tree; //forward decl<br /> template &lt;class T&gt;<br /> class bnode {<br /> private:<br /> friend class gen_tree&lt;T&gt;;<br /> bnode&lt;T&gt;* left;<br /> bnode&lt;T&gt;* right;<br /> T data;<br /> int count;<br /> bnode(T d, bnode&lt;T&gt;* l, bnode&lt;T&gt;* r) :<br /> data(d), left(l), right(r), count(1) { }<br /> void print() const<br /> { cout &lt;&lt; data &lt;&lt; &quot; : &quot; &lt;&lt; count &lt;&lt; &quot;\t&quot;; }<br /> };<br /> template &lt;class T&gt;<br /> class gen_tree {<br /> public:<br /> gen_tree() { root = 0; }<br /> void insert(T d);<br /> T find(T d) const { return (find(root, d)); }<br /> void print() const { print(root); }<br /> private:<br /> bnode&lt;T&gt;* root;<br /> T find(bnode&lt;T&gt;* r, T d) const;<br /> void print(bnode&lt;T&gt;* r) const;<br /> };<br /> template &lt;class T&gt;<br /> void gen_tree&lt;T&gt;::insert(T d)<br /> {<br /> bnode&lt;T&gt;* temp = root;<br /> bnode&lt;T&gt;* old;<br /> if (root == 0) {<br /> root = new bnode&lt;T&gt;(d, 0, 0);<br /> return;<br /> }<br /> while (temp != 0) {<br /> old = temp;<br /> if (comp(temp -&gt; data, d) == 0) {<br /> (temp -&gt; count)++;<br /> return;<br /> }<br /> if (comp(temp -&gt; data, d) &gt; 0)<br /> temp = temp -&gt; left;<br /> else<br /> temp = temp -&gt; right;<br /> }<br /> if (comp(old -&gt; data, d) &gt; 0)<br /> old -&gt; left = new bnode&lt;T&gt;(d, 0, 0);<br /> else<br /> old -&gt; right = new bnode&lt;T&gt;(d, 0, 0);<br /> }<br /> template &lt;class T&gt;<br /> T gen_tree&lt;T&gt;::find(bnode&lt;T&gt;* r, T d) const<br /> {<br /> if (r == 0)<br /> return 0;<br /> else if (comp(r -&gt; data, d) == 0)<br /> return (r -&gt; data);<br /> else if (comp(r -&gt; data, d) &gt; 0)<br /> return (find( r -&gt; left, d));<br /> else<br /> return (find( r -&gt; right, d));<br /> }<br /> template &lt;class T&gt;<br /> void gen_tree&lt;T&gt;::print(bnode&lt;T&gt; *r) const<br /> {<br /> if (r != 0) {<br /> print( r -&gt; left);<br /> r -&gt; bnode&lt;T&gt;::print();<br /> print ( r -&gt; right);<br /> }<br /> }<br /> template &lt;class T&gt; //general case<br /> int comp(T i, T j)<br /> {<br /> if (i == j) //assumes == &lt; defined for T<br /> return 0;<br /> else<br /> return ( (i &lt; j) ? -1 : 1 );<br /> }<br /> //specialization for const char*<br /> int comp(const char* i, const char* j){<br /> return (strcmp(i, j));<br /> }<br /> int main()<br /> {<br /> char dat[256];<br /> gen_tree&lt;char*&gt; t;<br /> char* p;<br /> while (cin&gt;&gt;dat){<br /> p = new char[strlen(dat) + 1];<br /> strcpy(p, dat);<br /> t.insert(p);<br /> }<br /> t.print();<br /> cout &lt;&lt; &quot;EOF&quot; &lt;&lt; endl &lt;&lt; endl;<br /> gen_tree&lt;int&gt; i_tree;<br /> for (int i = 15; i &gt; -5; --i)<br /> i_tree.insert(i);<br /> i_tree.print();<br /> }<br /> <br /> <br /> &lt;/source&gt;<br /> <br /> <br /> ==Using Default Arguments with Template Classes==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> #include &lt;iostream&gt;<br /> #include &lt;cstdlib&gt;<br /> using namespace std;<br /> <br /> template &lt;class T=int, int size=10&gt; class MyClass {<br /> T a[size]; // size of array is passed in size<br /> public:<br /> MyClass() {<br /> register int i;<br /> for(i=0; i&lt;size; i++) a[i] = i;<br /> }<br /> T &amp;operator[](int i);<br /> };<br /> <br /> template &lt;class T, int size&gt;<br /> T &amp;MyClass&lt;T, size&gt;::operator[](int i)<br /> {<br /> if(i&lt;0 || i&gt; size-1) {<br /> cout &lt;&lt; &quot;\nIndex value of &quot;;<br /> cout &lt;&lt; i &lt;&lt; &quot; is out-of-bounds.\n&quot;;<br /> exit(1);<br /> }<br /> return a[i];<br /> }<br /> <br /> int main()<br /> {<br /> MyClass&lt;int, 100&gt; intarray; <br /> MyClass&lt;double&gt; doublearray; <br /> MyClass&lt;&gt; defarray; <br /> <br /> cout &lt;&lt; &quot;int array: &quot;;<br /> for(int i=0; i&lt;100; i++) intarray[i] = i;<br /> for(int i=0; i&lt;100; i++) cout &lt;&lt; intarray[i] &lt;&lt; endl;<br /> <br /> cout &lt;&lt; &quot;double array: &quot;;<br /> for(int i=0; i&lt;10; i++) doublearray[i] = (double) i/3;<br /> for(int i=0; i&lt;10; i++) cout &lt;&lt; doublearray[i] &lt;&lt; endl;<br /> <br /> cout &lt;&lt; &quot;defarray array: &quot;;<br /> for(int i=0; i&lt;10; i++) defarray[i] = i;<br /> for(int i=0; i&lt;10; i++) cout &lt;&lt; defarray[i] &lt;&lt; endl;<br /> <br /> return 0;<br /> }<br /> <br /> <br /> <br /> &lt;/source&gt;<br /> <br /> <br /> ==Using exceptions with templates.==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> #include &lt;iostream&gt;<br /> using namespace std;<br /> const int DefaultSize = 10;<br /> class xBoundary {};<br /> template &lt;class T&gt;<br /> class Array<br /> {<br /> public:<br /> Array(int itsSize = DefaultSize);<br /> Array(const Array &amp;rhs);<br /> ~Array() { delete [] pType;}<br /> Array&amp; operator=(const Array&lt;T&gt;&amp;);<br /> T&amp; operator[](int offSet);<br /> const T&amp; operator[](int offSet) const;<br /> int GetitsSize() const { return itsSize; }<br /> friend ostream&amp; operator&lt;&lt; (ostream&amp;, const Array&lt;T&gt;&amp;);<br /> class xSize {};<br /> private:<br /> int *pType;<br /> int itsSize;<br /> };<br /> template &lt;class T&gt;<br /> Array&lt;T&gt;::Array(int size):<br /> itsSize(size)<br /> {<br /> if (size &lt;10 || size &gt; 30000)<br /> throw xSize();<br /> pType = new T[size];<br /> for (int i = 0; i&lt;size; i++)<br /> pType[i] = 0;<br /> }<br /> template &lt;class T&gt;<br /> Array&lt;T&gt;&amp; Array&lt;T&gt;::operator=(const Array&lt;T&gt; &amp;rhs)<br /> {<br /> if (this == &amp;rhs)<br /> return *this;<br /> delete [] pType;<br /> itsSize = rhs.GetitsSize();<br /> pType = new T[itsSize];<br /> for (int i = 0; i&lt;itsSize; i++)<br /> pType[i] = rhs[i];<br /> }<br /> template &lt;class T&gt;<br /> Array&lt;T&gt;::Array(const Array&lt;T&gt; &amp;rhs)<br /> {<br /> itsSize = rhs.GetitsSize();<br /> pType = new T[itsSize];<br /> for (int i = 0; i&lt;itsSize; i++)<br /> pType[i] = rhs[i];<br /> }<br /> template &lt;class T&gt;<br /> T&amp; Array&lt;T&gt;::operator[](int offSet)<br /> {<br /> int size = GetitsSize();<br /> if (offSet &gt;= 0 &amp;&amp; offSet &lt; GetitsSize())<br /> return pType[offSet];<br /> throw xBoundary();<br /> return pType[0];<br /> }<br /> template &lt;class T&gt;<br /> const T&amp; Array&lt;T&gt;::operator[](int offSet) const<br /> {<br /> int mysize = GetitsSize();<br /> if (offSet &gt;= 0 &amp;&amp; offSet &lt; GetitsSize())<br /> return pType[offSet];<br /> throw xBoundary();<br /> }<br /> template &lt;class T&gt;<br /> ostream&amp; operator&lt;&lt; (ostream&amp; output, const Array&lt;T&gt;&amp; theArray)<br /> {<br /> for (int i = 0; i&lt;theArray.GetitsSize(); i++)<br /> output &lt;&lt; &quot;[&quot; &lt;&lt; i &lt;&lt; &quot;] &quot; &lt;&lt; theArray[i] &lt;&lt; endl;<br /> return output;<br /> }<br /> int main(){<br /> try<br /> {<br /> Array&lt;int&gt; intArray(9);<br /> for (int j = 0; j&lt; 100; j++)<br /> {<br /> intArray[j] = j;<br /> cout &lt;&lt; &quot;intArray[&quot; &lt;&lt; j &lt;&lt; &quot;] okay...&quot; &lt;&lt; endl;<br /> }<br /> }<br /> catch (xBoundary)<br /> {<br /> cout &lt;&lt; &quot;Unable to process your input!\n&quot;;<br /> }<br /> catch (Array&lt;int&gt;::xSize)<br /> {<br /> cout &lt;&lt; &quot;Bad Size!\n&quot;;<br /> }<br /> cout &lt;&lt; &quot;Done.\n&quot;;<br /> return 0;<br /> }<br /> <br /> <br /> &lt;/source&gt;<br /> <br /> <br /> ==Using Non-Type Arguments with Generic Classes==<br /> <br /> <br /> <br /> &lt;source lang=&quot;cpp&quot;&gt; <br /> #include &lt;iostream&gt;<br /> #include &lt;cstdlib&gt;<br /> using namespace std;<br /> <br /> template &lt;class T, int size&gt; class MyClass {<br /> T a[size]; // length of array is passed in size<br /> public:<br /> MyClass() {<br /> register int i;<br /> for(i=0; i&lt;size; i++) a[i] = i;<br /> }<br /> T &amp;operator[](int i);<br /> };<br /> <br /> template &lt;class T, int size&gt;<br /> T &amp;MyClass&lt;T, size&gt;::operator[](int i)<br /> {<br /> if(i&lt;0 || i&gt; size-1) {<br /> cout &lt;&lt; i &lt;&lt; &quot; is out-of-bounds.\n&quot;;<br /> exit(1);<br /> }<br /> return a[i];<br /> }<br /> <br /> int main()<br /> {<br /> MyClass&lt;int, 10&gt; intob; <br /> MyClass&lt;double, 15&gt; doubleob; <br /> <br /> for(int i=0; i&lt;10; i++) <br /> intob[i] = i;<br /> for(int i=0; i&lt;10; i++) <br /> cout &lt;&lt; intob[i] &lt;&lt; endl;<br /> <br /> for(int i=0; i&lt;15; i++) <br /> doubleob[i] = (double) i/3;<br /> for(int i=0; i&lt;15; i++) <br /> cout &lt;&lt; doubleob[i] &lt;&lt; &quot; &quot;;<br /> <br /> return 0;<br /> }<br /> <br /> <br /> <br /> &lt;/source&gt;</div> Admin

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48