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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:14:30+00:00 2026-05-15T11:14:30+00:00

why this error: #include <vector> typedef double point[2]; int main() { std::vector<point> x; }

  • 0

why this error:

#include <vector>
typedef double point[2];

int main()
{
     std::vector<point> x;
}
/usr/include/c++/4.3/bits/stl_construct.h: In function ‘void std::_Destroy(_Tp*) [with _Tp = double [2]]’:
/usr/include/c++/4.3/bits/stl_construct.h:103:   instantiated from ‘void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = double (*)[2]]’
/usr/include/c++/4.3/bits/stl_construct.h:128:   instantiated from ‘void std::_Destroy(_ForwardIterator, _ForwardIterator, std::allocator&) [with _ForwardIterator = double (*)[2], _Tp = double [2]]’
/usr/include/c++/4.3/bits/stl_vector.h:300:   instantiated from ‘std::vector::~vector() [with _Tp = double [2], _Alloc = std::allocator]’
prova.cpp:8:   instantiated from here
/usr/include/c++/4.3/bits/stl_construct.h:88: error: request for member ‘~double [2]’ in ‘* __pointer’, which is of non-class type ‘double [2]’

how to solve?

  • 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-15T11:14:31+00:00Added an answer on May 15, 2026 at 11:14 am

    You can’t do that. As mentioned, arrays are not copyable or assignable which are requirements for std::vector. I would recommend this:

    #include <vector>
    struct point {
        double x;
        double y;
    };
    
    int main() {
         std::vector<point> v;
    }
    

    It will read better anyway since you can do things like:

    put(v[0].x, v[0].y, value);
    

    which makes it more obvious this the vector contains points (coordinates?)

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

Sidebar

Related Questions

hi can anybody tell me the error in this? #include<stdio.h> int main() { char
I am unclear about the following. First, this code compiles fine: #include <vector> typedef
I am getting this error when I include an opensource library that I had
I include this library: #include <QtCopyDialog> When i compile, i see this error QtCopyDialog:
This is the error: Parse error: syntax error, unexpected '}' in /home/idghosti/public_html/testground/mma/include/footer.php on line
I get an undefined reference to 'typeof'-error compiling and linking this: #include <stdio.h> #include
Please see this example: if (strlen($_SESSION['userDetails']['THISNAME']) == 0) { $_SESSION['userDetails'][''.$THISNAME.'Error'] = autofocus; include $docRoot/html/forms/reg/user_info.html.php;
The following piece of code #include <iostream> #include <vector> #include <tuple> using namespace std;
#include <vector> struct A {int a;}; struct B : public A {char b;}; int
I have typedef std::queue<MyObject*> InputQueue; std::vector<InputQueue> inp_queue; Now what I want to do is

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.