Skip to content

Boost format stray roundup#1515

Open
johnhaddon wants to merge 6 commits intoImageEngine:mainfrom
johnhaddon:formatFollowup
Open

Boost format stray roundup#1515
johnhaddon wants to merge 6 commits intoImageEngine:mainfrom
johnhaddon:formatFollowup

Conversation

@johnhaddon
Copy link
Member

This fixes a couple of strays that escaped the purge in #1514, and a couple of associated issues. I found these by removing support for boost::format() from the MessageHandler class. @ivanimanishi, if that is a step too far then just let us know and we can drop that commit from this PR. The single remaining boost::format() usage is now inFileSequence::fileNameTemplate(), which is a protected method. There are no derived classes that can make use of it in Cortex or Gaffer, so I wonder if IE has something internally using it, or if it should have been private all along. If the latter, then I'll remove it too.

Copy link
Collaborator

@murraystevenson murraystevenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks John! Changes look good from my perspective. Great to see we're almost free of boost::format()...

@johnhaddon
Copy link
Member Author

@ivanimanishi, can I take your silence as approval? :)

Copy link
Member

@ivanimanishi ivanimanishi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll have to update our internal repositories, but if I understand correctly, if we start using fmt::format() in our code, it should still work with older cortex (10.5 and 10.6), right (since it would just be returning an std::string)?
If that's the case, then I'm ok with approving this PR.

@johnhaddon
Copy link
Member Author

Yes, you'll be able to do msg( level, context, fmt::format( ... ) ) in all Cortex versions - as you say, it just returns a string. It is a reasonable effort to move all the boost::format() over to fmt::format() (I did most of it for Gaffer), but it's so much nicer once it's done. OK to merge then?

@johnhaddon
Copy link
Member Author

johnhaddon commented Feb 19, 2026

I've pushed two more commits : one removes FileSequence::fileNameTemplate(), and the other fixes a bad format string in SceneCache. With this merged, we will be free of boost::format() everywhere.

We only have one owner, and `unique_ptr` makes that clear. I only spotted this after removing a `boost/format.hpp` include from another header. These two files weren't including `boost/shared_ptr.hpp` themselves, and were instead getting it transitively from the other header.
And replace with direct use of `fmt::format()` internally. This removes the final usage of `boost::format()` from Cortex.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments