Can the following code be considered a strategy pattern?
Can the following piece of code be considered a strategy pattern? Or is it something else? Or is there no template at 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 i = load<bigEndian>(buf);
...
}
+3
source to share
No one has answered this question yet
See similar questions:
or similar: