Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. Inheriting a template class

Inheriting a template class

Scheduled Pinned Locked Moved Managed C++/CLI
c++question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Subin Mavunkal
    wrote on last edited by
    #1

    Hi , I have a template class like template public ref class MyBaseclass. I need to inherit this class on another one like. public ref class Derivedclass:MybaseClass. Could you please let me know whats the syntax for doing like this ?Sorry I am new to VC++.

    G 1 Reply Last reply
    0
    • S Subin Mavunkal

      Hi , I have a template class like template public ref class MyBaseclass. I need to inherit this class on another one like. public ref class Derivedclass:MybaseClass. Could you please let me know whats the syntax for doing like this ?Sorry I am new to VC++.

      G Offline
      G Offline
      George L Jackson
      wrote on last edited by
      #2

      template<typename T>
      ref class Base
      {
      public:
      Base(T value) : _value(value) {}
      T get_value() { return _value; }
      private:
      T _value;
      };

      ref class Derived : Base<String^>
      {
      public:
      Derived(String^ value) : Base(value) {}
      };

      "We make a living by what we get, we make a life by what we give." --Winston Churchill

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups