boost::rational issue with ios_base constructor

Open
#44 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp
Domain
compilers

Research direction

Start by reproducing the overload example using boost/rational.hpp and the Wandbox link, then inspect the interaction with the ios_base.h error reported from GCC's standard library. Confirm what causes the compilation failure and define done as making the shown program compile without regressing rational behavior.

Written by the indexing model from the issue text.

Description

Code fails to compile if boost::rational is used as the parameter to a function that also shares a signature with a void* - for example:

#include <boost/rational.hpp>

void foo(void(*)()) {}
void foo(boost::rational<int>) {}

void fun() {}

int main() {
  foo(fun);
}

https://wandbox.org/permlink/a06FvkYIP5asIys0

This returns an error in from /opt/wandbox/gcc-head/include/c++/11.0.0/bits/ios_base.h:41,

Apologies since I'm not familiar with the code enough to give a better example/understanding of what's happening. Please let me know what other information I can provide or how I can help get this sorted.

thanks,
John

Dominant language
C++
Stars
24
Forks
44
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/rational

All issues in boostorg/rational

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.