lang:c:syntaxe:heritage
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| lang:c:syntaxe:heritage [2017/08/08 17:10] – ↷ Liens modifiés en raison d'un déplacement. root | lang:c:syntaxe:heritage [2017/11/23 23:42] (Version actuelle) – supprimée root | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====Méthodes statiques dans une interface==== | ||
| - | Normalement, | ||
| - | [[http:// | ||
| - | |||
| - | L' | ||
| - | <code cpp> | ||
| - | template < typename T > | ||
| - | class StaticInterface | ||
| - | { | ||
| - | public: | ||
| - | StaticInterface() | ||
| - | { | ||
| - | int(*fooCheck)(int) | ||
| - | bool(*barCheck)(bool) = T::bar; | ||
| - | } | ||
| - | }; | ||
| - | </ | ||
| - | |||
| - | Une implémentation de la classe : | ||
| - | <code cpp> | ||
| - | class DerivedClass : public StaticInterface< | ||
| - | { | ||
| - | public: | ||
| - | static int foo(int | ||
| - | static bool bar(bool param){ return 20; } | ||
| - | }; | ||
| - | </ | ||
lang/c/syntaxe/heritage.1502205014.txt.gz · Dernière modification : de root
