0

I need to remove boost from this code. For some reason when calling the reference of the std::array now gives an error. Why?

Here are the arrays:

std::array<grid_dim, 3> gd; 
//boost::array<grid_dim, 3> gd;

Here is the struct:

struct grid_dim
{
    double begin;
    double end;
    std::size_t n; // number of intervals == number of sample points - 1
    grid_dim() : begin(0), end(0), n(0) {}
    double span() const { return end - begin; }
    bool enabled() const { return (n > 0); }
private:
    friend class boost::serialization::access;
    template<class Archive>
    void serialize(Archive& ar, const unsigned version) {
        ar & begin;
        ar & end;
        ar & n;
    }
};

Here is the call:

void main_procedure(...,const grid_dims& gd,...)

Here is the error:

Error   2   error C2664: 'main_procedure' : cannot convert parameter 8 from 'std::tr1::array<_Ty,_Size>' to 'const grid_dims &' C:\vina_code\vinaSingleThread\src\main\main.cpp 706 1   vinaSingleThread

Thank you for your time!

1 Answer 1

1

According to the error message, you are passing std::array to const grid_dims& gd. I guess you should change the parameter type to const std::array<grid_dim, 3>&

Sign up to request clarification or add additional context in comments.

1 Comment

@JonathanSaboury likely because grid_dims is a typedef for boost::array<grid_dim, 3>?!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.