Ok andreas,

I will do it with a pair of pair ... but I found the syntax very
heavier than with boost::tuple.

Take a look at the example in attached file, this is the approach I
will take to replace the boost::tuple.
And this approach is not very usable if we have to extend the "tuple".

Regards,

jonathan Muller.



On Mon, Nov 3, 2008 at 8:02 PM, Andreas Volz <[EMAIL PROTECTED]> wrote:
> Am Mon, 3 Nov 2008 09:56:45 +0100 schrieb Jonathan MULLER:
>
> Hello Jonathan,
>
> would be nice if you do that. And best provide a path to integrate it
> into eflpp.
>
> BTW: Seems you're not a member of
> enlightenment-devel@lists.sourceforge.net list. You should join the
> list if you like to post anything
>
> regards
> Andreas
>
>> Hi Andreas,
>>
>> I understand those problematics of course.
>> The dependency is on tuple classe with 3 elements ... we could in a
>> first time considering a std::pair of std::pair
>>
>> boost::tuple < Ty, int, bool > ~ std::pair < std::pair< Ty, int >,
>> bool >
>>
>> It will be a bit more heavy for the user ... but I can have a look to
>> develop this.
>>
>> I have to say adding a dependncy on boost would be a great idea.
>>
>> Regards,
>>
>> Jonathan Muller.
>>
>> On Sun, Nov 2, 2008 at 12:03 PM, Andreas Volz
>> <[EMAIL PROTECTED]> wrote:
>> > Am Sat, 1 Nov 2008 21:14:57 +0100 schrieb Jonathan MULLER:
>> >
>> > Hello Jonathan,
>> >
>> > I reviewed the source code short and this it looks good. But
>> > there's a little problem. Until now the eflpp library hasn't any
>> > boost dependency.
>> >
>> > Using your eet wrapper would create a dependency to boost for all
>> > applications based on eflpp. For me personal this isn't a big
>> > problem as my main application is yet based on boost for some other
>> > reasons.
>> >
>> > The positive would be that it allows to replace some other stuff in
>> > eflpp with boost code. But as this is a design decision I'm not sure
>> > about it. At least I like to discuss that topic on the list. I added
>> > the list to Cc.
>> >
>> > Meanwhile you could think about if it's not possible to rewrite your
>> > wrapper with STL classes.
>> >
>> > Any other opinions from the list?
>> >
>> > regards
>> > Andreas
>> >
>> > BTW: I didn't attach the source code to this E-Mail. You've to ask
>> > Jonathan about it.
>> >
>> >> Hi Andreas,
>> >>
>> >> You will find in as attached file the wrapper.
>> >> execute
>> >> make to build the 2 executables
>> >>
>> >> and make test to run first the writing test and the the readin
>> >> test. And take a look at the code ;)
>> >>
>> >> I am waiting for your feedbacks.
>> >> I do not have rights to commit in the SVN tree that's why I send
>> >> you this first approach.
>> >>
>> >> Note : you have to have the boost tuple library.
>> >>
>> >>
>> >> Regards,
>> >>
>> >> John aka Bhaal22.
>> >>
>> >> On Fri, Oct 31, 2008 at 9:09 PM, Andreas Volz
>> >> <[EMAIL PROTECTED]> wrote:
>> >> > Am Mon, 27 Oct 2008 16:01:30 +0200 schrieb Jonathan MULLER:
>> >> >
>> >> > Hello Jonathan,
>> >> >
>> >> > I'm interested in your wrapper. Do you've a patch based on
>> >> > existing eflpp code base? It should fit into the eflpp design.
>> >> >
>> >> > regards
>> >> > Andreas
>> >> >
>> >> >> Hi Andreas,
>> >> >>
>> >> >> I wrote a little C++ wrapper around Eet library compliant with
>> >> >> STL. I can use STL algorithm to iterate over keys, entries ...
>> >> >>
>> >> >> I wrote some operators to access items in a user friendly way.
>> >> >>
>> >> >> I can show you if you want.
>> >> >>
>> >> >> Regards,
>> >> >>
>> >> >> Jonathan Muller.
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Drylm Founder
>> >> >> http://www.drylm.org
>> >> >>
>> >> >
>> >> >
>> >> > --
>> >> > Technical Blog <http://andreasvolz.wordpress.com/>
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Drylm Founder
>> >> http://www.drylm.org
>> >>
>> >
>> >
>> > --
>> > Technical Blog <http://andreasvolz.wordpress.com/>
>> >
>>
>>
>>
>> --
>> Drylm Founder
>> http://www.drylm.org
>>
>



-- 
Drylm Founder
http://www.drylm.org
#include <utility>
#include <iostream>


template <typename _Ty>
struct A
{
  typedef std::pair<_Ty, int> type;
};

template <typename _Ty>
struct B
{
  typedef typename A<_Ty>::type internal_type;
  typedef std::pair< internal_type, bool> type;
};


template <typename _Ty>
typename A<_Ty>::type make_a (_Ty ty, int i)
{
  //typename A<_Ty>::type f (ty, i);

  return typename A<_Ty>::type (ty, i);;
}

template <typename _Ty>
typename B<_Ty>::type
make_b (_Ty ty, int i, bool b)
{
  return typename B<_Ty>::type ( make_a(ty, i), b);
}


int main (int argc, char **argv)
{
  A<int>::type x = make_a (12, 12);
  B<int>::type b;

  b.first = std::make_pair (12, 13);
  b.second = false;

  B<int>::type b2 = make_b(12, 13, false);
  B<int>::type b3 = make_b(25, 15, true);


  

  std::cout << x.first << " " << x.second << std::endl;

  std::cout << b2.first.first << " " << b2.first.second << " " << b2.second << std::endl;
  std::cout << b3.first.first << " " << b3.first.second << " " << b3.second << std::endl;
  return 0;
}

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to