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

  • SEARCH
  • Home
  • 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 8363355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:09:26+00:00 2026-06-09T12:09:26+00:00

typedef std::chrono::duration<int, std::ratio_multiply<std::ratio<12, 34>, std::ratio<9>>> irrelevant; void func(irrelevant){} // comment this out to make

  • 0
typedef std::chrono::duration<int, std::ratio_multiply<std::ratio<12, 34>, std::ratio<9>>> irrelevant;

void func(irrelevant){} //  comment this out to make it work
void func(std::chrono::seconds){}
void func(std::chrono::minutes){}

int main()
{
    func(std::chrono::seconds(43));
}

Above, the inclusion of an overload that takes an irrelevant causes a bunch of errors, like:

‘std::ratio_divide<_R1,_R2>::type’ is not a member of a base class of ‘std::ratio_divide<_R1,_R2>’

Is there actually something wrong, or is VS2012 to blame? How can I work around it?

  • 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-06-09T12:09:27+00:00Added an answer on June 9, 2026 at 12:09 pm

    I don’t have access to VS2012, but see if this works:

    typedef std::chrono::duration<int, std::ratio_multiply<std::ratio<12, 34>, std::ratio<9> >::type> irrelevant;
    

    Your code compiles for me in C++11 mode, but not in C++03 mode (clang/libc++). My theory is that VS2012 hasn’t yet implemented template aliases, or if it has, its <chrono> hasn’t yet reacted to the availability of template aliases. As a fall back, ratio_multiply has a nested type type which should do the job.

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

Sidebar

Related Questions

Consider this program: #include <map> #include <vector> typedef std::vector<int> IntVector; typedef std::map<IntVector,double> Map; void
Simple question; right now I have something like this: typedef void(*MyFunctionPointer)(int); typedef std::vector <
void main() { typedef boost::ptr_map<int, char> MyMap; //typedef std::map<int, char *> MyMap; // in
I have the following code: #include<iostream> using namespace std; typedef void (*HandlerFunc)(int, int); HandlerFunc
Say want to store the following: typedef std::function<void(int)> MyFunctionDecl; ..in a collection: typedef std::vector<MyFunctionDecl>
Consider this simplified example: #include <list> typedef std::list<int> IntList; class KindaIntList { public: IntList::const_iterator
I've a hash table defined like this typedef std::unordered_map<unsigned long long int,unsigned long long
Here is my attempt at implementing a C++ event. class Event{ typedef std::tr1::function<void( int&
I have something like this: #include <iostream> namespace N { typedef std::pair<int, double> MyPair;
Consider the following piece of code: 1 typedef std::deque<int> mydeque_t; 2 mydeque_t mydeque; 3

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.