Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 583107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:45:28+00:00 2026-05-13T14:45:28+00:00

http://www.adp-gmbh.ch/cpp/templates/static_members.html makes it clear what I need to do – if the template has

  • 0

http://www.adp-gmbh.ch/cpp/templates/static_members.html makes it clear what I need to do – if the template has a single parameter.

What if it had two?

template <typename T, typename T2> class X {
  public:
     static int st_;
 };

How would I template the static memebr data?

template <typename T, typename T2> int, int X<T, T2>::st_;

or

template <typename T, typename T2> int int X<T, T2>::st_;

or what?

I think that my problem is knowinng what to do with the two real types (both int here).

After templating, how do I declare my static member variable?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:45:29+00:00Added an answer on May 13, 2026 at 2:45 pm
    template <typename T, typename T2>
    int X<T, T2>::st_;
    

    You don’t need two int-s. The int is the just type of st_.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Pay attention to base64_decode in http://www.adp-gmbh.ch/cpp/common/base64.html std::string base64_decode(std::string const& encoded_string) The function is suppose
http://www.adp-gmbh.ch/win/com/bho.html When I compile, I get lots of errors: error C2236: unexpected 'class' 'adpbho'.
http://www.boost.org/doc/libs/1_46_0/doc/html/boost_asio/example/chat/chat_client.cpp I am working on client application based on he example above. I wanted
From http://www.jibbering.com/faq/faq_notes/closures.html : Note: ECMAScript defines an internal [[prototype]] property of the internal Object
From http://www.faqs.org/rfcs/rfc2822.html : CR and LF MUST only occur together as CRLF; they MUST
I went to http://www.json.org/js.html and downloaded the json2.js, thinking i'd be fine, afterall that
Seeing this: http://www.suckless.org/wiki.html . A wiki based on Mercurial. Are there any other non-code
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html According to that article STL isn't suited for game-development. What are your thoughts
http://www.stockmapper.com/NDXtrac.html Would be possible to develop the above chart using SVG and Javascript or
http://www.ioplex.com/jespa.html I am following the example as described in Providing NTLM Services without Active

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.