Rewrite.
Simplified namespace nesting. Refactor virtual setter method name.
This commit is contained in:
@@ -4,17 +4,13 @@
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
namespace settable {
|
||||
namespace setter {
|
||||
namespace string2type {
|
||||
namespace helper {
|
||||
template<>
|
||||
int convert<int>(const std::string &value) {
|
||||
return boost::lexical_cast<int>(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace string2type {
|
||||
|
||||
template<>
|
||||
int convert<int>(const std::string &value) {
|
||||
return boost::lexical_cast<int>(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
struct foo : settable::settable {
|
||||
@@ -32,4 +28,4 @@ int main(int argc, char *argv) {
|
||||
std::cout << f.x << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user