First version of the implementation with the generics.
Merge pull request #1 from antonini/master

First version of the implementation with the generics.