Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bug for Tick class for gcc < 11.2 #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

guzmalalo
Copy link

Fix bug for gcc < 11.2

 class std::basic_ostream<char>' has no member named 'str'
  679 |   name = (std::stringstream() << value).str();

temporary std::stringstream instances don’t support direct access to str() for gcc < 11.2

Proposed solution (line 679) :

	template<typename T>
	Tick(T v) : value(static_cast<double>(v)) {
		std::stringstream ss;
		ss << value;
		name = ss.str();
	}

Fix bug for gcc < 11.2

```bash
 class std::basic_ostream<char>' has no member named 'str'
  679 |   name = (std::stringstream() << value).str();
```

temporary std::stringstream instances don’t support direct access to str() for gcc < 11.2
@guzmalalo
Copy link
Author

To see this problem:

https://godbolt.org/z/7q4oY4bxP

@geraintluff geraintluff force-pushed the main branch 3 times, most recently from 0096ddc to 40160ca Compare April 3, 2025 13:18
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant