Skip to content

Instantly share code, notes, and snippets.

@lvpidadiao
Created October 18, 2019 08:02
Show Gist options
  • Save lvpidadiao/206ff84883716484a320f8cb9faa5cf5 to your computer and use it in GitHub Desktop.
Save lvpidadiao/206ff84883716484a320f8cb9faa5cf5 to your computer and use it in GitHub Desktop.
simple selector
class connbase {
public:
virtual void Send() = 0;
};
typedef enum {
WithEnc,
WithoutEnc
}enc;
template <enc T>
class connector : public connbase{
public:
void Send() override {
std::cout << "without encrypt " << std::endl;
};
};
template <>
void connector<enc::WithoutEnc>::Send() {
std::cout << "fuck you encrypt " << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment