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

  • Home
  • SEARCH
  • 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 8840955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:35:26+00:00 2026-06-14T10:35:26+00:00

i recently added: #define NOMINMAX #include <Windows.h> #include <algorithm> to my main.cpp in order

  • 0

i recently added:

#define NOMINMAX
#include <Windows.h>
#include <algorithm>

to my main.cpp in order to use

std::max( x , x ); // x is just a placeholder and not actual anything
std::min( x  , x );

but i can’t use std::max()/std::min() in other files.

error C2589: '(' : illegal token on right side of '::'
error C2059: syntax error : '::'

i tried to add #define NOMINMAX in my other files, but fails. what is the clue?

i looked around before asking, but i don’t understand the answer Possible problems with NOMINMAX on Visual C++

  • 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-14T10:35:27+00:00Added an answer on June 14, 2026 at 10:35 am

    If you’re really desperate, put parentheses around the function names:

    (std::min)(x, y);
    

    This syntax won’t apply a function-like macro. (Formally, to apply a function-like macro the name of the macro must be followed by optional white space then a ‘(‘.)

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

Sidebar

Related Questions

I recently added CKEditor to my app and I would like to include my
How to get only recently added Order ? class Order(models.Model): STATUSS = ( (u'E',
I'm using JSF2.0 and Eclipse Indigo, and just recently I added the PrimeFaces library
I recently added an extra authentication backend to allow users to login using either
I recently added a stored procedure to my SQL Azure database. I added that
I recently added Autofac 2.6.2 to one of my ASP.NET MVC projet. I'm facing
I recently added Android's LVL copy protection to my app, and the results have
I recently added a feature to a large application written in Delphi (version 2009)
I recently added these lines to my ~/.bashrc file to show the current branch
I recently added a parameter to one of the method of a wcf. It

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.