МАТЕМАТИКА, КОМПЮТЪРНИ НАУКИ И ОБРАЗОВАНИЕ
ВЕЛИКОТЪРНОВСКИ УНИВЕРСИТЕТ "СВ. СВ. КИРИЛ И МЕТОДИЙ" - УНИВЕРСИТЕТСКО ИЗДАТЕЛСТВО

Алтернатива на виртуалните функции в съвременния C++. Приложение в обучението


Автори:
Ивайло Дончев Великотърновски университет „Св. св. Кирил и Методий“, България

Страници: 144-159
DOI: https://doi.org/10.54664/KPDP6631

Резюме:


Although virtual functions are a convenient object-oriented programming mechanism, they come at a cost in terms of additional computational resources. Additionally, the vulnerabilities related to the implementation of this mechanism have long been known. On the other hand, domains in which C++ is used assume high code efficiency and uncompromising reliability and safety. In this study, problems related to virtual functions, optimization and vulnerability mitigation techniques, as well as alternative methods are analyzed. A new non-virtual approach has been developed, based on the modern language features described in the C++20 and C++23 standards. This approach can improve performance and security while maintaining flexibility in software development. Aspects of integration of the approach into student training are discussed.


Ключови думи:

virtual function, type erasure, vtable, concept, variadic templates, metaprogramming, education.

Изтегляне


139 изтегляния от 9.12.2025 г.