Re: Problem: Cannot create class out of nothing using witchcraft

2013-10-16 Thread Benjamin Thaut
Am 16.10.2013 03:17, schrieb DoctorCaptain: I've gotten extremely close. The DPaste link that follows demonstrates three different templates: ... So is there any reason why you still pass the variadic arguments to the generator function and not do it the way I proposed in my last dpaste

Re: Problem: Cannot create class out of nothing using witchcraft

2013-10-16 Thread DoctorCaptain
On Wednesday, 16 October 2013 at 06:09:48 UTC, Benjamin Thaut wrote: Am 16.10.2013 03:17, schrieb DoctorCaptain: I've gotten extremely close. The DPaste link that follows demonstrates three different templates: ... So is there any reason why you still pass the variadic arguments to the

Re: Problem: Cannot create class out of nothing using witchcraft

2013-10-16 Thread Benjamin Thaut
Oh something I forgot. You should really start littering your code with pragma(msg, ...) statements to better understand what it does. You can for example make your generator output pramga(msg, T.stringof); to find out what T actually is. Kind Regards Benjamin Thaut

Re: Problem: Cannot create class out of nothing using witchcraft

2013-10-16 Thread Benjamin Thaut
Am 16.10.2013 10:40, schrieb DoctorCaptain: On Wednesday, 16 October 2013 at 06:09:48 UTC, Benjamin Thaut wrote: Am 16.10.2013 03:17, schrieb DoctorCaptain: I've gotten extremely close. The DPaste link that follows demonstrates three different templates: ... So is there any reason why you

Re: Problem: Cannot create class out of nothing using witchcraft

2013-10-16 Thread Benjamin Thaut
Am 16.10.2013 10:40, schrieb DoctorCaptain: http://dpaste.dzfl.pl/07b20d75 Note the use of typeof() to get the type of the elements at each index of members, to generate a type on which a constructor can be called to instantiate the elements at each index of members. Magic. There is actually

Re: Problem: Cannot create class out of nothing using witchcraft

2013-10-16 Thread Benjamin Thaut
Am 16.10.2013 16:08, schrieb Benjamin Thaut: Am 16.10.2013 10:40, schrieb DoctorCaptain: http://dpaste.dzfl.pl/07b20d75 Note the use of typeof() to get the type of the elements at each index of members, to generate a type on which a constructor can be called to instantiate the elements at

Re: Problem: Cannot create class out of nothing using witchcraft

2013-10-16 Thread DoctorCaptain
AWW you posted that while I was writing my latest novel. So T[i] doesn't work? I guess I shouldn't have opened my eyes this morning. In any case, typeof() DOES work, so as long as there is a way to extract the type, we're good. I am extremely pleased it's actually possible to get individual

Re: Problem: Cannot create class out of nothing using witchcraft

2013-10-16 Thread DoctorCaptain
On Wednesday, 16 October 2013 at 18:47:25 UTC, Benjamin Thaut wrote: Am 16.10.2013 16:08, schrieb Benjamin Thaut: Am 16.10.2013 10:40, schrieb DoctorCaptain: http://dpaste.dzfl.pl/07b20d75 Note the use of typeof() to get the type of the elements at each index of members, to generate a type

Re: Problem: Cannot create class out of nothing using witchcraft

2013-10-16 Thread Benjamin Thaut
Am 16.10.2013 21:02, schrieb DoctorCaptain: On Wednesday, 16 October 2013 at 14:08:52 UTC, Benjamin Thaut wrote: Am 16.10.2013 10:40, schrieb DoctorCaptain: http://dpaste.dzfl.pl/07b20d75 Note the use of typeof() to get the type of the elements at each index of members, to generate a type on

Problem: Cannot create class out of nothing using witchcraft

2013-10-15 Thread DoctorCaptain
dmd v2.063.2 Hi there! I'm terribly hopeful that you're more interested in the problem at hand than my choice of title. I've been using D for a while as my language of choice for various projects here and there, and I've recently discovered that template programming is magic. This is good. As

Re: Problem: Cannot create class out of nothing using witchcraft

2013-10-15 Thread Benjamin Thaut
Am 15.10.2013 10:03, schrieb DoctorCaptain: dmd v2.063.2 Hi there! I'm terribly hopeful that you're more interested in the problem at hand than my choice of title. I've been using D for a while as my language of choice for various projects here and there, and I've recently discovered that

Re: Problem: Cannot create class out of nothing using witchcraft

2013-10-15 Thread Benjamin Thaut
Your going way to complicated by actually passing the variadic arguments to the generator function. If you don't pass the variadic arguments to the generator function its way simpler and also works ;-) http://dpaste.dzfl.pl/59e2547b

Re: Problem: Cannot create class out of nothing using witchcraft

2013-10-15 Thread Artur Skawina
On 10/15/13 10:03, DoctorCaptain wrote: If what I am asking is unclear, I will be more than happy to explain in a different way. I tried to be simultaneously as succinct and as comprehensive as possible with what the issue is. I'm not sure what exactly you're trying to do, but... The issue

Re: Problem: Cannot create class out of nothing using witchcraft

2013-10-15 Thread DoctorCaptain
Fixing links: If the template I am trying to instantiate IS NOT variadic, and I pass in an alias of an instantiated template, then the receiving template has all of the type information it needs. Example: dpaste.dzfl.pl/6d618af9 http://dpaste.dzfl.pl/6d618af9 If the template I am trying to

Re: Problem: Cannot create class out of nothing using witchcraft

2013-10-15 Thread DoctorCaptain
On Tuesday, 15 October 2013 at 13:14:46 UTC, Benjamin Thaut wrote: Your going way to complicated by actually passing the variadic arguments to the generator function. If you don't pass the variadic arguments to the generator function its way simpler and also works ;-)

Re: Problem: Cannot create class out of nothing using witchcraft

2013-10-15 Thread DoctorCaptain
I missed an extremely critical point. The working example with the single arbitrary template instantiation as a data member of the generated class, http://dpaste.dzfl.pl/6d618af9 , has the template instantiation aliases inside of main, meaning the alias is NOT within the scope of GrabBagT, but

Re: Problem: Cannot create class out of nothing using witchcraft

2013-10-15 Thread DoctorCaptain
I've gotten extremely close. The DPaste link that follows demonstrates three different templates: The first template is capable of generating the string for and mixing in the definition of a class that has a single arbitrary argument. An object of that class is instantiated, and its