c++ - Could following code be considered strategy pattern? -
could following code snippet considered strategy pattern? or else? or no pattern @ all?
template <bool bigendian> void load(char * buf); template <> int load<false>(char * buf) { ... } template <> int load<true>(char * buf) { ... } template <bool bigendian> class loader { ... // somewhere in code int = load<bigendian>(buf); ... }
Comments
Post a Comment