[phobos] phobos commit, revision 1678

Steve Schveighoffer schveiguy at yahoo.com
Tue Jun 22 11:10:05 PDT 2010


I have a question.  When a template is used only for static checking, such as static asserts and template constraints, is it's typeinfo and paraphernalia included in the resulting executable?  I don't think it should be, otherwise bloat will ensue...

-Steve



----- Original Message ----
> From: Andrei Alexandrescu <andrei at erdani.com>
> To: Discuss the phobos library for D <phobos at puremagic.com>
> Sent: Tue, June 22, 2010 2:01:32 PM
> Subject: Re: [phobos] phobos commit, revision 1678
> 
> Yes.

Andrei

On 06/22/2010 12:24 PM, Brad Roberts wrote:
> 
> Should all the ranges have that sort of static assert to make sure they 
> satisfy
> the intended set of attributes?
>
> On 6/22/2010 
> 8:03 AM, Andrei Alexandrescu wrote:
>> I think just issuing an 
> assert(isForwardRange!(typeof(repeat(1))) should
>> 
> suffice.
>>
>> Andrei
>>
>> On 06/22/2010 
> 09:58 AM, David Simcha wrote:
>>> Realistically, how would you 
> recommend testing something like this?  I
>>> checked to make 
> sure that there was something instantiating each version
>>> of the 
> structs to make sure that they compile (i.e. no silly syntax
>>> 
> errors), and as for the logical correctness, it seemed like the code 
> was
>>> so trivial that it would  be silly to write an explicit 
> test for it.
>>> Furthermore, the precedent in the rest of Phobos 
> seems to be that such
>>> trivial code does not require 
> testing.
>>>
>>> On Tue, Jun 22, 2010 at 10:30 AM, Brad 
> Roberts<
> href="mailto:braddr at puremagic.com">braddr at puremagic.com
>>> 
> <mailto:
> href="mailto:braddr at puremagic.com">braddr at puremagic.com>>  
> wrote:
>>>
>>>      On 6/22/2010 5:31 AM, 
> 
> href="http://dsource.org">dsource.org<http://dsource.org>  
> wrote:
>>>       >  phobos commit, revision 
> 1678
>>>       >
>>>    
>    >
>>>       >  user: 
> dsimcha
>>>       >
>>>    
>    >  msg:
>>>       >  Bug 
> 4362:  std.range.repeat and cycle do not have a .save() 
> method
>>>       >
>>>    
>    >  
> http://www.dsource.org/projects/phobos/changeset/1678
>>>
>>>  
>     Don't forget to add unit tests. :)
>>>    
>   _______________________________________________
>>>  
>     phobos mailing list
>>>      
> ymailto="mailto:phobos at puremagic.com" 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com<mailto:
> ymailto="mailto:phobos at puremagic.com" 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com>
>>>  
>     
> http://lists.puremagic.com/mailman/listinfo/phobos
>>>
>>>
>>>
>>>
>>> 
> _______________________________________________
>>> phobos mailing 
> list
>>> 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com
>>> 
> href="http://lists.puremagic.com/mailman/listinfo/phobos" target=_blank 
> >http://lists.puremagic.com/mailman/listinfo/phobos
>> 
> _______________________________________________
>> phobos mailing 
> list
>> 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com
>> 
> href="http://lists.puremagic.com/mailman/listinfo/phobos" target=_blank 
> >http://lists.puremagic.com/mailman/listinfo/phobos
>
> 
> _______________________________________________
> phobos mailing 
> list
> 
> href="mailto:phobos at puremagic.com">phobos at puremagic.com
> 
> href="http://lists.puremagic.com/mailman/listinfo/phobos" target=_blank 
> >http://lists.puremagic.com/mailman/listinfo/phobos
_______________________________________________
phobos 
> mailing list

> href="mailto:phobos at puremagic.com">phobos at puremagic.com

> href="http://lists.puremagic.com/mailman/listinfo/phobos" target=_blank 
> >http://lists.puremagic.com/mailman/listinfo/phobos


      


More information about the phobos mailing list