From: John P. F. <jf...@ov...> - 2008-10-26 15:43:09
|
Kim Gräsman wrote: > Hi John, > > On Thu, Oct 23, 2008 at 23:38, John P. Feltz <jf...@ov...> wrote: > >> typedef URI< >> URI<>, >> std::string, >> HostConnection, >> std::string, >> std::string >> > HTTP; >> >> class HostConnection { >> public: >> std::string getName() const; >> const int* getPort() const; >> >> HostConnection(const HostConnection& other); >> ~HostConnection(); >> >> private: >> friend HostConnection* parse<std::string, HostConnection> >> (std::stack<std::string>& errors, const std::string& input); >> >> HostConnection(const std::string& name, const int* port); >> >> const std::string m_name; >> const int* m_port; >> }; >> > > Looks pretty interesting. I like how the parse function is free and > separated from the data struct. > > Can parse(string, URI) transparently use parse(string, HostConnection) > based on the template args as well? > > Thanks, > - Kim > > ------------------------------------------------------------------------- > 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=/ > _______________________________________________ > Cpp-netlib-devel mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel > > Thus far - this is just a specialization for that specific type if I understand what you're asking: template<> HostConnection* parse<std::string, HostConnection> (std::stack<std::string>& errors, const std::string& input) {....} John |