template Test(alias T){
pragma(msg, T.stringof);
enum Test = T.stringof;
}
string t1;
void t2(){}
void t3(string s){}
extern(C) void main(){
enum x1 = Test!(t1); // ok
enum x2 = Test!(t2); // expect t2, but get t2()
enum x3 = Test!(t3); //Error:
On Saturday, 20 July 2019 at 03:31:41 UTC, Newbie2019 wrote:
template Test(alias T){
pragma(msg, T.stringof);
Believe it or not, but this can result in the function being
called. This is D's optional parenthesis feature, to do simple
property syntax.
Not a bug.
I want get the
On Saturday, 20 July 2019 at 03:58:36 UTC, Adam D. Ruppe wrote:
You should never actually need that! What is your use case?
In most cases I see people doing .stringof, the correct
solution is to simply... not. Use the local name directly.
If you do need the name - and the only cases for this
On Saturday, 20 July 2019 at 04:10:53 UTC, Newbie2019 wrote:
I may not fully understand why I can done it without
identifier.stringof
show me what you're doing now and I'll see which case it is. Most
the time I see these, the code is significantly simplified and
bugs fixed by removing the
On Saturday, 20 July 2019 at 04:18:15 UTC, Adam D. Ruppe wrote:
show me what you're doing now and I'll see which case it is.
Most the time I see these, the code is significantly simplified
and bugs fixed by removing the usages of these strings..
I want to do this in betterC:
template
If you've been anticipating the TreeView examples, today's post
is where the rubber hits the road with a look at the differences
and similarities between populating a ComboBox and a TreeView.
You can find it here:
https://gtkdcoding.com/2019/07/19/0054-mvc-vii-treeview-basics.html
for example:
void ASSERT(string fmt, string file = __FILE_FULL_PATH__, size_t
line = __LINE__, T...) (bool c, scope T a) @nogc {
assert(c, string, file, line);
}
but i get this error:
error.d(39): Error: found file when expecting )
error.d(39): Error: found ) when expecting ; following
On 2019-07-19 17:30, Newbie2019 wrote:
for example:
void ASSERT(string fmt, string file = __FILE_FULL_PATH__, size_t line =
__LINE__, T...) (bool c, scope T a) @nogc {
assert(c, string, file, line);
}
but i get this error:
error.d(39): Error: found file when expecting )
error.d(39):
On Friday, 19 July 2019 at 15:30:25 UTC, Newbie2019 wrote:
for example:
void ASSERT(string fmt, string file = __FILE_FULL_PATH__,
size_t line = __LINE__, T...) (bool c, scope T a) @nogc {
assert(c, string, file, line);
}
but i get this error:
error.d(39): Error: found file when
On Thursday, 18 July 2019 at 21:09:53 UTC, vladislavp wrote:
Hello,
I am trying to create a 'boiler plate' project
that's essentially uses only betterC libraries
(and itself is betterC)
for my needs I would like to use mir-optim
(this is a linear optimization betterC lib)
However, I cannot
10 matches
Mail list logo