#compacting macros

146 messages ยท Page 1 of 1 (latest)

proven totem
echo hearthBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

merry storm
#

I think repr has a cursed macro for that

proven totem
#

o

proven totem
#

@tawdry badger can you share pls?

merry storm
#

might of been @dapper garnet 's

proven totem
#

haha yes bring in more people to this thread

dapper garnet
#

@empty marlin show them

proven totem
#

lol

dapper garnet
proven totem
#

my goal here is to be able to generate as many overloads of this function as is reasonable using only macros

#

because no external tools or prior configuration >:(

dapper garnet
#

If you care about compile times the only good way is to codegen beforehand

proven totem
#

well i did once

#

but the file took up like 3 megabytes?

#

this is already a big improvement but i think it could be even less

proven totem
#

hmm

#

so you'd recommend I just dont make macros?

#

yours is already 107 KB

proven totem
merry storm
dapper garnet
#

Sorry about the embeds, can't seem to remove them on mobile

merry storm
#

I wrote some absolute spaghetti codegen for a thing like this ๐Ÿ˜›

dapper garnet
noble plover
#

Mfw genuinely advanced c++ auto-reflection out of stubborness on a lol

proven totem
dapper garnet
#

Not that I care but I don't think that's an appropriate way to use otherwise licensed code @merry storm - that algorithm was committed under MIT license, so you need to at least mark it as such - just stating which project you lifted it from isn't sufficient afaik

proven totem
#

is it limited in identifier name length?

dapper garnet
#

Especially given this looks more like an exact copy than a reimplementation ๐Ÿ˜›

merry storm
#

is hardly a copy paste but ya I'm no legal expert

dapper garnet
proven totem
#

aa

dapper garnet
#

But yeah same here, pretty much just guessing

proven totem
noble plover
#

me of course

merry storm
#

uhh ya prolly him ๐Ÿ™‚

proven totem
#

aha

dapper garnet
#

I'd probably copy the license header from the project and place a permlink to the specific commit

merry storm
#

ya commit perma link would be an improvement at least

proven totem
noble plover
dapper garnet
proven totem
#

also wait this requires boost?

empty marlin
#

@proven totem you can use Boost.pp to implement the iteration

proven totem
#

no boost >:(

empty marlin
#

Then, open the library files, study how they work

merry storm
#

the arity/member counters shouldn't require boost

proven totem
#

boost is included in the godbolt link for some reaosn

empty marlin
noble plover
#

when I made it it had 0 dependency

merry storm
#

o I'm not using any boost headers/boost code here

#

I'm not sure why the library was ticked on in the godbolt ๐Ÿ™‚

empty marlin
dapper garnet
noble plover
dapper garnet
#

I think I only did some slight refactorings to it

#

But yeah, repr is zero required dependencies

noble plover
merry storm
dapper garnet
noble plover
dapper garnet
#

Illegal

merry storm
proven totem
proven totem
#

i'm in the process of rewriting it completely

proven totem
noble plover
#

yeah

proven totem
#

got it ๐Ÿ‘

noble plover
#

you can link to the original commit

proven totem
#

yeah

#

i'm following good programming manners :)

tawdry badger
#

u only need it in one place

#

and expanding the macros takes up unnecessary time

proven totem
#

i may have found a better solution

#

if i can detect the number of elements at compiletime, i just need one overload

tawdry badger
#

u can

#

in 26 u can also use auto&& [args...] i think

proven totem
#

and so far it seems like it wont limit me to 256 elements?

proven totem
#

wonder if gcc has implemented it yet though

merry storm
#

a chain of if constexpr's was limited to 121 in some compilers, though seems like an overload-approach accepts more

tawdry badger
#

its cool how far this has come

proven totem
#

is that pack indexing?

tawdry badger
proven totem
tawdry badger
#

u should test the compile times

#

idk if the if constexpr is gonna be faster

proven totem
#

:)

#

taking a byte from runtime to compiletime

tawdry badger
#

shouldnt use static_cast<void>

proven totem
#

it surely has absolutely no downsides

proven totem
tawdry badger
#

literally just because its weird for the sake of it

#

ppl are used to (void)

proven totem
#

ewwwww

#

c-style cast

tawdry badger
#

thats the convention

proven totem
#

gross

#

fine maybe i'll consider it

#

opening an issue

tawdry badger
#

i still use c style casts in certain places

#

just not in templates

#

unless its a base cast

proven totem
echo hearthBOT
#

@proven totem Has your question been resolved? If so, type !solved :)

proven totem
#

no

proven totem
tawdry badger
#

ong

proven totem
#

line 39

#

actually unreadable

merry storm
#

owait that's stddef.h in C

tawdry badger
#

cstddef

#

cstdint has the intX_ts

proven totem
merry storm
#

but ya that is one thing I'm not in the strong habit of qualifying and probably should be

merry storm
#

now this convo is dragging me away from the project I want to be finishing to fix some things in reflection ๐Ÿ˜ฆ

tawdry badger
#

lucky it died...

proven totem
#

for now

proven totem
#

only attribute specifiers in c++26

merry storm
#

what's the phrase...

#

structured bindings can introduce a pack?

proven totem
#

o

merry storm
#

probably not finished yet if it is going to make it in

proven totem
#

i see

tawdry badger
#

well

#

but it just crashes lmao

proven totem