View Issue Details

IDProjectCategoryView StatusLast Update
0003959The Dark ModCodingpublic16.07.2017 01:03
Reportergreebo Assigned Tostgatilov  
PrioritynormalSeveritynormalReproducibilityhave not tried
Status resolvedResolutionfixed 
Product VersionTDM 2.03 
Target VersionTDM 2.06Fixed in VersionTDM 2.06 
Summary0003959: Try to reduce boost dependencies by using standard C++11 features
DescriptionNow that Visual Studio 2013 is in place we can look into replacing some of boost's functionality with C++11 language features.
TagsNo tags attached.

Relationships

related to 0003252 closedstgatilov See if we can remove the boost library 

Activities

grayman

grayman

03.01.2016 18:10

viewer   ~0007949

This was filed a year ago. Not likely to be worked on soon. Moving it to 2.05.
stgatilov

stgatilov

15.04.2017 07:16

administrator   ~0008793

Replaced boost::shared_ptr with std::shared_ptr in svn rev 6810.
I think std::shared_ptr is working even in MSVC2010...
stgatilov

stgatilov

28.06.2017 11:13

administrator   ~0008936

Well, some thoughts about the remaining part.

boost::trim + boost::classification + boost::split + boost::join: just implement this thing in idlib or somewhere else and replace usages.
boost::predicate + boost::case_conv: implement manually.
boost::lexical_cast: it seems not even used now.
boost::noncopyable: write two private or deleted copy methods instead.
boost::function: replace with std::function.
boost::bind: use lambda.

boost::posix_time: find some lightweight HPC timer, or maybe even use clock (I guess high precision is not necessary here).

boost::spirit: parse the freaking ini file manually, or even using idlib's parser (not sure it is is suitable).

boost::filesystem: simply replace with std::filesystem.
It has appeared in MSVC2012 already, and GCC supports it for quite a long time too. Just check that they work nicely.
stgatilov

stgatilov

10.07.2017 04:11

administrator   ~0008975

Removed most of boost in revisions 7012-7013.

Now boost is used only for:
  posix_time - GamePlayTimer
  spirit - IniFile
  filesystem - well, in several places

P.S. Note that boost will still be used in tdm_update, and I think it's better to simply leave it there =)
nbohr1more

nbohr1more

10.07.2017 04:36

developer   ~0008976

Hmm. 32-bit binary fails to be created for Windows MSVC 2013. The "tools" executable does build? Is that the plan? Rename the tools executable and use that?
stgatilov

stgatilov

10.07.2017 06:03

administrator   ~0008977

This is exactly why I was (and am) completely against having two copy/pasted projects.
I have just removed the no-tools version of TDM project from solution. Errors from that project will no longer bother anyone. Just use the "tools" version.
stgatilov

stgatilov

13.07.2017 03:21

administrator   ~0008984

Removed posix_time usage in 7032.
stgatilov

stgatilov

14.07.2017 14:42

administrator   ~0008989

Added wrapper for std::filesystem in revision 7034 and switched all the code from boost::filesystem to the new wrapper in revision 7035.

Yeah, it is a bit scary to be early adopter of C++17 standard library =)
I think if there would be any problems with it, we can solve them with MSVC update.
I have tested most of the code using filesystem, which is: choosing new mission to start, mission cleanup, space estimation, downloading new missions (including preview images). It seems to work, although it does not throw exception on errors (I did not manage to generate an exception).
stgatilov

stgatilov

15.07.2017 06:44

administrator   ~0008990

Removed usage of boost::spirit in IniFile in revision 7036.
It is amazing how a coder can decide to mess with such a bizarre thing instead of writing 30 simple lines of code himself.
stgatilov

stgatilov

15.07.2017 06:51

administrator   ~0008991

To recap: boost is NO longer used in TDM.
In revision 7038 I removed it from Linux build system (nothing to remove on Windows).
Note that if we want to revert back to boost::filesystem at some moment, we need to rollback commits 7038 and 7035.

P.S. Unfortunately, boost is still used in tdm_update, so we cannot delete it from SVN repository.
stgatilov

stgatilov

15.07.2017 07:04

administrator   ~0008992

Removed mentions of boost on coding-starter page:
  http://wiki.thedarkmod.com/index.php?title=Coding_in_the_SDK
I think it can be removed in more places after some time passes and we are sure that we won't rollback to boost::filesystem.

Issue History

Date Modified Username Field Change
07.12.2014 14:45 greebo New Issue
07.12.2014 14:45 greebo Status new => assigned
07.12.2014 14:45 greebo Assigned To => greebo
03.01.2016 18:10 grayman Note Added: 0007949
03.01.2016 18:10 grayman Target Version TDM 2.04 => TDM 2.05
21.10.2016 15:33 grayman Target Version TDM 2.05 => TDM 2.06
15.04.2017 07:16 stgatilov Note Added: 0008793
28.06.2017 11:13 stgatilov Note Added: 0008936
09.07.2017 10:18 stgatilov Assigned To greebo => stgatilov
10.07.2017 04:11 stgatilov Note Added: 0008975
10.07.2017 04:36 nbohr1more Note Added: 0008976
10.07.2017 06:03 stgatilov Note Added: 0008977
13.07.2017 03:21 stgatilov Note Added: 0008984
14.07.2017 14:42 stgatilov Note Added: 0008989
15.07.2017 06:44 stgatilov Note Added: 0008990
15.07.2017 06:51 stgatilov Note Added: 0008991
15.07.2017 06:52 stgatilov Status assigned => resolved
15.07.2017 06:52 stgatilov Fixed in Version => TDM 2.06
15.07.2017 06:52 stgatilov Resolution open => fixed
15.07.2017 07:04 stgatilov Note Added: 0008992
16.07.2017 01:03 nbohr1more Relationship added related to 0003252