Topic: constexpr functions without constexpr specifier:


Author: =?UTF-8?Q?Germ=C3=A1n_Diago?= <germandiago@gmail.com>
Date: Mon, 20 Oct 2014 03:26:32 -0700 (PDT)
Raw View
------=_Part_3170_950335902.1413800793671
Content-Type: text/plain; charset=UTF-8


>
>
> For example, it would be nice in Lua or Squirrel, to be able to use these
> functions as constexpr to embed the bytecode directly.
> Otherwise, if you want to achieve this effect, you have to basically
> reimplement everything only because the original API
> won't work at compile-time.
>
>
Reading again  makes me see how inaccurate I was. Imagine you have:

char * compile_string(const char * str);

It would be nice to be able to use that in a metaprogram and generate a
char array somewhere. I don't know if it is understandable.
This way, this API could be used at compile-time. So during development,
you use the scripts at runtime. Designers can, many people
can. When delivering, everything is inside the executable, including the
bytecode or the machine code to be executed, without any
runtime overhead. Not the strings to be compiled. This would be specially
useful in not so powerful devices.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_3170_950335902.1413800793671
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><div><br></div><div>For example, it would be nice in Lua or Squirrel, t=
o be able to use these functions as constexpr to embed the bytecode directl=
y.&nbsp;</div><div>Otherwise, if you want to achieve this effect, you have =
to basically reimplement everything only because the original API</div><div=
>won't work at compile-time.</div><div><br></div></div></blockquote><div>&n=
bsp;</div><div>Reading again &nbsp;makes me see how inaccurate I was. Imagi=
ne you have:</div><div><br></div><div>char * compile_string(const char * st=
r);</div><div><br></div><div>It would be nice to be able to use that in a m=
etaprogram and generate a char array somewhere. I don't know if it is under=
standable.</div><div>This way, this API could be used at compile-time. So d=
uring development, you use the scripts at runtime. Designers can, many peop=
le</div><div>can. When delivering, everything is inside the executable, inc=
luding the bytecode or the machine code to be executed, without any</div><d=
iv>runtime overhead. Not the strings to be compiled. This would be speciall=
y useful in not so powerful devices.</div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_3170_950335902.1413800793671--

.