Inheritance and Virtual Table are often used to create interface in C++ polymorphic class
What if ... there were another way to do this ?
easier, cleaner, faster and more reliable
This article explains how to useCRTP
, [std::variant
](https://en.cppreference.com/w/cpp/utility/variant andstd::visit
to increase code performance.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set inotify watch limit high enough for IntelliJ IDEA (PhpStorm, PyCharm, RubyMine, WebStorm). | |
# 1. Check current value in use: `cat /proc/sys/fs/inotify/max_user_watches` | |
# 2. Create this file as /etc/sysctl.d/60-jetbrains.conf (Debian, Ubuntu, Fedora...) | |
# 3. Apply new configuration: `sudo sysctl -p --system` or `sudo service procps start` or reboot | |
# 4. Check new value in use: `cat /proc/sys/fs/inotify/max_user_watches` | |
# | |
# References: | |
# * https://gist.github.com/olibre/a0219529a6cc347494f40780e7e539eb | |
# * https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Original work: https://gist.github.com/odeblic/fa54037bf4d764a5dc02735cb4bd79f3 | |
* Inspired from: https://youtu.be/ZiNGWHg5Z-o | |
* | |
* Compile | |
* | |
* $ g++ -Wall -Wextra smart_dtor.cpp | |
* | |
* Run | |
* |