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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:04:59+00:00 2026-05-14T14:04:59+00:00

You can display a Value’s type like this: cout << val.type() << end; and

  • 0

You can display a Value’s type like this:

cout << val.type() << end;

and it print a number.

How can I map this number back to the actual type?

besides peeking in the header file, of course, which reveals all…

enum Value_type {
    obj_type,array_type,str_type,bool_type,int_type,real_type,null_type
};
  • 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-05-14T14:05:00+00:00Added an answer on May 14, 2026 at 2:05 pm

    Nope, that seems to be the canonical way:

        switch(v.type()) {
            case obj_type:    pp_obj(v, lev+1);   break;
            case array_type:  pp_array(v, lev+1); break;
            case str_type:    pp<string>(v, lev+1);   break;
            case bool_type:   pp<bool>(v, lev+1);  break;
            case int_type:    pp<int>(v, lev+1);   break;
            case real_type:   pp<double>(v, lev+1);  break;
            case null_type:   pp_null(v, lev+1);  break;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I display this value in the loop ? echo '<input type=hidden name=eg_payamt_'.$i.'
I can display a simple Visual Basic inputbox from a PowerShell script like this:
Is this right? I am trying to display value in input box dynamically? can
I have this for pagination on a project. How can I display the value
yes what returned can be formatted using HH to display value in 24hrs, but
Is there any way we can enable highcharts to display marker value at all
Can any one tell me how to display a dataset value from the web
How can i reset a display:none and add some value here is the code
How can I display the value of a radio button in a form text
How can I display a DATETIME value ( 2010-12-02 15:20:17.000 ) as 02/12-2010 15:20

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.