Похожие чаты

Speaking of compile time programming... I was trying to find some

solution to create compile time computed strings from strings I supply.
Like, imagine a simple string preprocessor that removes the occurrences of the letter 'z' from the input string.
All I found was unreadable dark template magic, or macro usage, which in this case may be better (if you ignore type safety and other possible hidden bugs lurking).
I'm also limited by c++11
Ideas?

6 ответов

4 просмотра

Well if people managed to get regex engines written in templates, I'm sure you can do this simple task.

C++20 allows us to use string in constexpr and consteval functions so you can but caveats exists...

Add another build step that generates C++ code from Python or something.

There's Cython, but that's just C.

Avihay-B Автор вопроса
BSP
Add another build step that generates C++ code fro...

I did. It works, but it's not inline in the code next to where it needs to be, so it's not optimal

Ender
There's Cython, but that's just C.

Actually using a different language like say Python was a quite common in C++ world and is still is, for meta programming stuff..

Похожие вопросы

Обсуждают сегодня

Is UniBright Freequity an active live product ? A friend here in Asia was discussing the Tokenisation of RWA’s in his case Real Estate as he’s a developer with numerous overs...
Digital Trust
4
коллеги, добрый вечер! А никто не знает как модальная форма может себя закрыть? Ну допустим модальная форма определила, что смысла ей работать нет и хочет вернуть modalResult...
Михаил
83
Hi, is it fine to use git to backup my config? I did so many things that I don't want to miss if I switched to another OS, so how do you backup your home and configs? And shou...
Adnan Al_Beda
30
Добрый день задумываюсь о создание токена из за того что много свободного времени и вот я узнал что транзакции за перевод этого токена будут в waves и тут пришла идея при тран...
Артем
3
Zapper планирует свой токен. Агрегатор DeFi и трекер портфолио портфелем ценных бумаг Zapper представил протокол Zapper, целью которого является стимулирование и контекстуал...
Foxcool
3
А если изначально бот работал так : есть сайт онлайн школы. У каждого ученика свой кабинет. Где он авторизуется по своим данным. И уже в кабинете, на самом сайте делает оплату...
Денис 💡 Фрилансер
13
Hi, I am a bit confused... I just unbonded on app.persistence.one stkSTARS/STARS with a liquidity of $127. From a time period of 60 days and a reward percentage of 9.72% at t...
Matias
6
Добрый день Хочу начать обучение языку, не являюсь представителем it, буду благодарна за помощь, совсем пока не понимаю ничего) Подскажите, пожалуйста, где можно начать первы...
Sara Lala
19
А что ты вообще делаешь ?
Yesgoter
13
средствами IBX как-то можно выполнить запрос insert ... returning?
Igor
31
Карта сайта