works as expected
import std.traits : isSomeChar;
import std.range: ElementEncodingType;
import std.stdio;
@safe pure nothrow
template CharEncodingType(Char)
{
alias ET = ElementEncodingType!Char;
static if (is (ET == char)) {
alias CharEncodingType = ubyte;
} else st
I try this
import std.traits : isSomeChar;
import std.typetuple: TypeTuple;
import std.stdio;
template CharEncodingType(Char)
{
// Get representation type
alias TypeTuple!(ubyte, ushort, uint) U;
// const and immutable storage classes
static if (is(Char == immutabl
On Tuesday, 19 November 2013 at 23:53:33 UTC, bioinfornatics
wrote:
On Tuesday, 19 November 2013 at 06:11:26 UTC, Ali Çehreli wrote:
On 11/18/2013 07:48 PM, bioinfornatics wrote:
On Thursday, 14 November 2013 at 12:01:04 UTC, Ali Çehreli
wrote:
On 11/13/2013 04:32 PM, bioinfornatics wrote:
Hi
On Tuesday, 19 November 2013 at 06:11:26 UTC, Ali Çehreli wrote:
On 11/18/2013 07:48 PM, bioinfornatics wrote:
On Thursday, 14 November 2013 at 12:01:04 UTC, Ali Çehreli
wrote:
On 11/13/2013 04:32 PM, bioinfornatics wrote:
Hi,
I try to understand which type char, dchar, wchar will give
ubyte,u
On 11/18/2013 07:48 PM, bioinfornatics wrote:
On Thursday, 14 November 2013 at 12:01:04 UTC, Ali Çehreli wrote:
On 11/13/2013 04:32 PM, bioinfornatics wrote:
Hi,
I try to understand which type char, dchar, wchar will give
ubyte,ushort,uint…
And for templates, there is std.range.ElementEncodin
On Thursday, 14 November 2013 at 12:01:04 UTC, Ali Çehreli wrote:
On 11/13/2013 04:32 PM, bioinfornatics wrote:
Hi,
I try to understand which type char, dchar, wchar will give
ubyte,ushort,uint…
And for templates, there is std.range.ElementEncodingType:
import std.stdio;
import std.range;
vo
On 11/13/2013 04:32 PM, bioinfornatics wrote:
Hi,
I try to understand which type char, dchar, wchar will give
ubyte,ushort,uint…
And for templates, there is std.range.ElementEncodingType:
import std.stdio;
import std.range;
void foo(R)(R range)
{
// In contrast, ElementType!R for strings
To expand on bearophile's answer, a dynamic array is basically a
package of two things: a length and a pointer to the contents.
Each of these is 8 bytes on a 64-bit system, thus the sizeof a
dynamic array is 16 bytes.
You are asking how char, wchar, and dchar correspond to integer
types. That
bioinfornatics:
each time it seem ushort is used someone coul explaen please?
sizeof of a dynamic array always gives 2 * size_t.sizeof = 8 or
16 bytes.
Bye,
bearophile