Похожие чаты

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 ответов

6 просмотров

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..

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

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

$params = [ 'formid' => 'feedbackForm', 'formTpl' => '@CODE: <form class="form-validate" data-id="ajax_form"> <fieldset class="margin-bottom-md"> ...
Pathologic
1
anyways, anybody know an OPEN SOURCE bitcoincash wallet for android that doesn't take 15 minutes to sync everytime i open it? (looking at you ElectronCash) i really liked Bitc...
Senko-san
21
Каким то образом можно определить ширину экрана пользователя перед загрузкой partial-а? Надо рассчитать ширину кадров слайдера для ресайза картинок для container-fluid.
Point 111
22
'frakturBold' => ['𝖆', '𝖇', '𝖈', '𝖉', '𝖊', '𝖋', '𝖌', '𝖍', '𝖎', '𝖏', '𝖐', '𝖑', '𝖒', '𝖓', '𝖔', '𝖕', '𝖖', '𝖗', '𝖘', '𝖙', '𝖚', '𝖛', '𝖜', '𝖝', '𝖞', '𝖟', '𝕬', '𝕭', '𝕮', '𝕯'...
Roma
4
И ещё вопрос: можно ли типа как на дос как-то запариться и с помощью прерываний выводить текст, вместо функции printf ?
НѣкъиⰘижєжєиꙁъвьсєсвѣтьноѣсѣтиѥсть•
34
окей, дело реально в org было. но что за мусор в конце?
Vi Chapmann
15
Ладно, ещё тупого спрошу. Код должен банально вывести значение регистра на консоль, на деле же не выводя ничего, просто оставляя нерабочую консоль (открыта, ничего не написан...
НѣкъиⰘижєжєиꙁъвьсєсвѣтьноѣсѣтиѥсть•
25
Есть тут крутые SQL-маньяки (в частности postgresql)? Нужна помощь, совет, что-то всю голову сломал, не могу придумать как реализовать нужное. Есть вот такой набор данных: f...
Alex
11
How did we have so many dormant scammers in here? Who are these people. It’s been years. We know each other. If you dm me “I’ve been an og” but haven’t said a single word her...
Justin | LGCY |
49
Is UNIBRIGHT (UBT) Still A Good Investment in 2024? The Truth.. https://youtu.be/Uq9AuEmJ7B4
Ryan Rotolo (Crypto Fiend)
14
Карта сайта