Re: Calypso: Direct and full interfacing to C++

2015-02-08 Thread Elie Morisse via Digitalmars-d-announce

Small update: std::vector is now working.
  
https://github.com/Syniurge/Calypso/blob/master/tests/calypso/libstdc%2B%2B/vector.d


I went back to simpler problems than getting Ogre to work and 
will focus on the C++ standard lib until the common class 
templates work.


Re: Calypso: Direct and full interfacing to C++

2015-02-08 Thread Syro via Digitalmars-d-announce

On Sunday, 8 February 2015 at 16:49:44 UTC, Elie Morisse wrote:

Small update: std::vector is now working.
  
https://github.com/Syniurge/Calypso/blob/master/tests/calypso/libstdc%2B%2B/vector.d


That is really cool.


Re: Calypso: Direct and full interfacing to C++

2015-02-08 Thread Elie Morisse via Digitalmars-d-announce

On Sunday, 8 February 2015 at 20:56:31 UTC, Syro wrote:

That is really cool.


Thanks, just got that tangled mess of templates that is 
std::string working too:


https://github.com/Syniurge/Calypso/blob/master/tests/calypso/libstdc%2B%2B/string.d


Re: Calypso: Direct and full interfacing to C++

2015-02-08 Thread Suliman via Digitalmars-d-announce

If somebody have working Windows build, could you please share it?


Re: Calypso: Direct and full interfacing to C++

2015-02-08 Thread Elvis Zhou via Digitalmars-d-announce

On Sunday, 8 February 2015 at 22:45:14 UTC, Elie Morisse wrote:

On Sunday, 8 February 2015 at 20:56:31 UTC, Syro wrote:

That is really cool.


Thanks, just got that tangled mess of templates that is 
std::string working too:


https://github.com/Syniurge/Calypso/blob/master/tests/calypso/libstdc%2B%2B/string.d


Congrats! This is definitely an exciting news!!


Re: Calypso: Direct and full interfacing to C++

2015-02-08 Thread Kelly via Digitalmars-d-announce

On Sunday, 8 February 2015 at 22:45:14 UTC, Elie Morisse wrote:

On Sunday, 8 February 2015 at 20:56:31 UTC, Syro wrote:

That is really cool.


Thanks, just got that tangled mess of templates that is 
std::string working too:

On Sunday, 8 February 2015 at 22:45:14 UTC, Elie Morisse wrote:

On Sunday, 8 February 2015 at 20:56:31 UTC, Syro wrote:

That is really cool.


Thanks, just got that tangled mess of templates that is 
std::string working too:


Hey Elie, this is great stuff, as usual. I have written a test 
file for bitset here also (including a couple failures I am sure 
you are aware of, but others might want to see what works and 
what doesn't).



/**
 * std::bitset example.
 *
 * Build with:
 *   $ ldc2 -L-lstdc++ bitset.d
 */

modmap (C++) bitset;

import std.stdio;
import (C++) std.bitset;

void main()
{
enum : ulong { A=0, B, C, D, E, F, G, H, numColors };
auto usedColors = new bitset!(numColors);

usedColors.set(A, true);
usedColors.set(C, true);

writeln(usedColors.len=\t, numColors);   // '8' as it 
should be

write(usedColors = \t);
if (usedColors.any())  // any() works
{
for(int i=0; iusedColors.size; i++)   // size seems to 
work

if (usedColors.test(i))// works
write('1');
else
write('0');
write('\n');   // prints 1010 for usedColors
}  // seems backwards also see 'b' 
below

   // is this right?

writeln(C bit = \t, usedColors.test(C));  // true as it 
should be
writeln(count = \t, usedColors.count());  // seems like 
count is
// 
working...returns 2
writeln(as ulong = \t, usedColors.to_ulong);  // '5' is 
correct


writeln(all = \t\t, usedColors.all);
writeln(none = \t\t, usedColors.none);// these work
writeln(any = \t\t, usedColors.any);

usedColors.flip(C);
writeln(C flipped = \t, usedColors.test(C));  // false as 
appropriate


write(b = \t\t);
auto a = new bitset!(4u)(0b0110);
auto b = new bitset!(4u)(0b1101);
for(int i=0; ib.size; i++)// size seems to work
{
if (b.test(i))
write('1'); // prints out 1011 for 'b'
else
write('0');
}
write('\n');
writeln(b as ulong = \t, b.to_ulong); // '13' is correct

// FAILURE in phobos format.d
//writeln(b);

// FAILURE because the [] operator isn't recognised
//writeln(usedColors[C]);

// FAILURE on operators again
//auto d = ab;

}

Thanks,
Kelly