Build error about LockingTextWriter

Ali Çehreli acehreli at yahoo.com
Sat Mar 3 13:38:27 PST 2012


On 03/03/2012 09:00 AM, bioinfornatics wrote:
 > Le samedi 03 mars 2012 à 07:38 -0800, Ali Çehreli a écrit :
 >> On 03/03/2012 06:11 AM, bioinfornatics wrote:
 >>   >  Dear,
 >>   >  i do not understand what is wrong in my code and produce this:
 >>   >
 >>   >  -------------------------
 >>   >  $ ldc2 ../../lib/libdscience-ldc.a -I=../.. fasta.d
 >>   >  /usr/include/d/std/range.d(295): Error: static assert  "Cannot 
put a
 >>   >  Sequence into a LockingTextWriter"
 >>   >       instantiatied in /usr/include/d/std/format.d(1512):
 >>   >  put!(LockingTextWriter,Sequence)
 >>   >       instantiatied in /usr/include/d/std/format.d(1869):
 >>   >  formatRange!(LockingTextWriter,Sequence,char)
 >>   >       instantiatied in /usr/include/d/std/format.d(2232):
 >>   >  formatValue!(LockingTextWriter,Sequence,char)
 >>   >       ... (1 instantiations, -v to show) ...
 >>   >       instantiatied in /usr/include/d/std/stdio.d(684):
 >>   >  formattedWrite!(LockingTextWriter,char,Sequence)
 >>   >       instantiatied in /usr/include/d/std/stdio.d(1563):
 >>   >  write!(Sequence,char)
 >>   >       instantiatied in fasta.d(12): writeln!(Sequence)
 >>   >  -------------------------
 >>   >
 >>   >
 >>   >  sequence file can be show here:
 >>   >
 >> 
https://gitorious.org/dscience/dscience/blobs/master/dscience/molecules/sequence.d
 >>   >
 >>   >
 >>   >  thanks
 >>   >
 >>
 >> Just by reading the code, LockingTextWriter can "put" only the dchar
 >> type. This is from std.stdio:
 >>
 >>           /// Range primitive implementations.
 >>           void put(A)(A writeme) if (is(ElementType!A : const(dchar)))
 >> // ...
 >>           void put(C)(C c) if (is(C : const(dchar)))
 >>
 >> I haven't tried it myself, but changing the return type of
 >> Sequence.front() to dchar would work.

I was wrong anyway. I think is(C : const(dchar)) means if C can 
implicitly be convertible to dchar. That is the case for char and wchar, 
so that can't be the reason.

 >>
 >> Ali
 >>
 >
 > thanks ali i have try but no same error

Sorry, no more ideas here. :(

Ali



More information about the Digitalmars-d-learn mailing list