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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:58:30+00:00 2026-06-16T04:58:30+00:00

I tried researching this, but could find a solution that fit my situation. So

  • 0

I tried researching this, but could find a solution that fit my situation.

So i’m trying to make a basic wrapper for the metadata of a mysql field:

#pragma once

#include <string>
#include <stdint.h>
#include <windows.h>
#include "mysql.h"


namespace escobar { namespace storage {

    class mysql_field_metadata
    {
    private:
        uint32_t result_index;          /* For indexing the field for a mysql record. */
        std::string name;               /* The name of the column. */
        std::string original_name;      /* The original name of the column, if the name is an alias. */
        std::string table;              /* Name of the table */
        std::string original_table;     /* The original name of the table, if the table name is an alias. */
        std::string database;           /* The name of the database the table/record belongs to. */
        uint32_t length;                /* The length of the field. */
        uint32_t max_length;            /* The maximum length of the set. */
        uint32_t decimals;              /* Number of decimals used in the field. */
        uint32_t charset;               /* Table charset. */
        enum enum_field_types type;     /* The type of MYSQL data. */

    public:
        mysql_field_metadata(MYSQL_FIELD* field_data, uint32_t _result_index) : 
            result_index(_result_index), name(field_data->name),
            original_name(field_data->org_name), table(field_data->table),
            original_table(field_data->org_table), database(field_data->db),
            length(field_data->length), max_length(field_data->max_length),
            decimals(field_data->decimals), charset(field_data->charsetnr),
            type(field_data->type)
        {
        }

        ~mysql_field_metadata(void) { }
        std::string get_name(void) { return this->name; }
        std::string get_original_name(void) { return this->original_name; }
        std::string get_table(void) { return this->original_name; }
        std::string get_original_table(void) { return this->original_table; }
        std::string get_database(void) { return this->database; }
        uint32_t get_length(void) { return this->length; }
        uint32_t get_max_length(void) { return this->max_length; }
        uint32_t get_decimals(void) { return this->decimals; }
        uint32_t get_charset(void) { return this->charset; }
        enum emum_field_types get_type(void) { return this->type; }
    };

}}

As you can see, my last function:

enum emum_field_types get_type(void) { return this->type; }

It doesn’t seem to be working, I get the following error:

error C2440: 'return' : cannot convert from 'enum_field_types' to 'escobar::storage::emum_field_types'
1> Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)

  • 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-16T04:58:32+00:00Added an answer on June 16, 2026 at 4:58 am

    You don’t need to prefix it with enum. You can try to remove it both from the function and the member and report back. It is possibly confusing the compiler.

    enum_field_types type;     /* The type of MYSQL data. */
    ...
    emum_field_types get_type(void) {
    

    Edit: To fix your “indentifier is undeclared” issue, use namespace::typename syntax if it in a namespace or ::typename if no namespace

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

Sidebar

Related Questions

This may sound like noobish question but I have tried researching these two classes
I really have tried researching this problem, but I'm now getting so close to
I'm a new user to C programming. I've tried researching this online, but couldn't
tried uncommenting pam_limits.so from the pam.d directory but no luck. Basic PAM seems to
Tried searching the site, but cannot find an answer to my problem: Lets say
tried to find the answer by googling and in MSDN but with no luck.
I've been researching this for a bit and I've found that copying a Sharepoint
this may seem obvious, but I've been researching this all night to no avail.
In researching this error I've come to the conclusion that it has to do
Can someone help me out with this error? I tried researching on the internet

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.