Hi. Yes, the thing is that if I want to add the String type without
modifying the original .cpp, it is not possible, since the compiler cannot
instantiate the member functions defined in the .cpp for the new type, then
there is a linker error. That´s why I was thinking if it wasn´t more
flexible to define the whole template in the header, like most template
definitions.
Thanks,
Fede
On Mon, Oct 23, 2017 at 9:16 AM, Goch, Caspar Jonas <
[email protected]> wrote:
> Hi,
>
>
>
> I agree with Daniel, either method should work.
>
>
>
> Best,
>
> Caspar
>
>
>
> *Von:* Daniel Maleike [mailto:[email protected] <[email protected]>]
> *Gesendet:* Montag, 23. Oktober 2017 09:15
> *An:* [email protected]; Federico Milano
> *Betreff:* Re: [mitk-users] Should the implementation of
> mitk::VectorProperty in its header file?
>
>
>
> Hi Federico,
>
> I wrote this class some time ago and I see nothing wrong in using it for
> different types than int or double. My only reason for keeping parts in a
> .cpp file was to have it compiled only once and not in every using code.
>
> A simple solution with the current code would be to use the DECLARE/DEFINE
> macros in a new file pair like mitkStringVectorProperty.h/.cpp or just
> adding the string type to mitkVectorProperty.h/.cpp. Given the small class
> size, I would not mind moving it to header-only, neither. Maybe someone
> from dkfz can give their opinion.
>
> Best regards,
> Daniel
>
> Federico Milano <[email protected]> hat am 19. Oktober 2017 um 18:08
> geschrieben:
>
> Hi. I was trying to use mitk::VectorProperty with a std::string, since I
> thought it would be possible (there are some tempting macros like
> MITK_DECLARE_VECTOR_PROPERTY and MITK_DEFINE_VECTOR_PROPERTY), but the
> implementation is wirtten completely in a cpp file. I have reimplemented it
> and moved it to a header file, but I thought that maybe there was a reason
> for not allowing to easily instantiate the VectorProperty using other types
> than int and double.
>
>
>
> Thanks!
>
>
>
> Federico
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot______
> _________________________________________
> mitk-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mitk-users
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users