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 8734815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:55:17+00:00 2026-06-13T09:55:17+00:00

I only need to use the iequals case-insensitive string comparison function from the BOOST

  • 0

I only need to use the iequals case-insensitive string comparison function from the BOOST library.

I am using #include <boost/algorithm/string.hpp> to import it.

Is there any way that I could only import the iequals function by itself?

The reason I even care (I am really just curious.) is because the compiled DLL is about 230kB if I don’t #include it and about 1.1MB if I do. It doesn’t really make much difference in this particular case how large the file is, but it seems like there is a lot of stuff that gets imported and never used. What if the library was a few GB and I only needed one of the functions? Then it would become an issue, I imagine.

I am admittedly naive when it comes to just about anything cpp-related, but I feel like it isn’t very efficient to include some 750kB of code when probably 90% of it isn’t used. It could be that the iequals function uses all of that 750kB, I have no idea.

Then again, if the iequals function includes many of the same libraries, the file would still be just as large.

Thoughts?

Thanks in advance for any advice.

EDIT:

Thanks for the responses. I am doing my best to understand them.

I am a chemical engineer who is rewriting a bunch of horribly slow and poorly optimized VBA macros into a C++ DLL. So far the results have been outstanding and everything functions correctly. I just don’t see the need for the extra file size if I only need to do a single type of comparison between two strings.

An example of the comparison I need to do is as follows:

if (SomeBSTR == "SomeTextHere") {
    // do stuff
}

or more exactly:

if (Gas == "Methane"    or
    Gas == "CH4"        or
    Gas == "C1")        return 1;

if (Gas == "Ethane"     or
    Gas == "C2H6"       or
    Gas == "C2")        return 2;

If this is the ONLY type of comparison that I have to do, can I do it in a more simple way than:

int wStrCmp(const BSTR Str1, const wstring Str2) {

    wstring wStr1(Str1, SysStringLen(Str1));

    return boost::iequals(Str1, Str2);
}

which is called via:

if (wStrCmp(Gas, L"Methane")      or
    wStrCmp(Gas, L"CH4")          or
    wStrCmp(Gas, L"C1"))          return 1; 

Those last 2 blocks are practically pasted from my code.

Thanks again, guys.

  • 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-13T09:55:18+00:00Added an answer on June 13, 2026 at 9:55 am

    believe me you already just include boost::algorithm::iequals but it use boost::range and std::locale that possibly you don’t use them in other places of your code, so this make your code a lot bigger, so I guess for your case there is no other way to do that unless you use some non-standard function like stricmp or strcasecmp.

    If you want to compare wide strings on Windows(for example BSTR) you can use _wcsicmp from CRT or lstrcmpiW from Windows runtime(declared in Kernel32.lib that possibly you already linked with it).

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

Sidebar

Related Questions

I have a use case where I only need to store certain fields to
I need to get only 1 record from sql result. we use SELECT TOP
Quick version of my question: Is the only time you need to use lock
I need to use unix Style line endings (only LF) in Zend Studio 8/9
Background We need to develop a specialised CMS (internal use only) to support a
I only need to use this class org.apache.commons.io.FileUtils, and yet I'm downloading all commons
to use @autowired. in xml, i only need to included <context:annotation-config /> ? is
I use the boost lexical_cast library for parsing text data into numeric values quite
I only need to download the first few kilobytes of a file via HTTP.
I only need a table to show 3 rows which get top 3 selling

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.