Skip to content

Get error C2664 when parse xview as an argument to a function  #2281

Open
@linggen

Description

@linggen

@jmp75 @kou @minrk @eric-wieser @luk036
source code:

using XBufferType = xt::xbuffer_adaptor<double*, xt::no_ownership>;
using XAdaptType = xt::xarray_adaptor<XBufferType, xt::layout_type::row_major, std::vector<int32_t>>;
using XViewType = xt::xview<XAdaptType&,xt::xall<long unsigned int>, xt::xall<long unsigned int>, xt::xall<long unsigned int>>;

void factor(XViewType & view){
	std::cout << view(0, 0, 0) << "," << view(0, 1, 0) << std::endl;
}

std::shared_ptr<XAdaptType> stock_xarray_ = std::make_shared<XAdaptType>(xt::adapt(stock_factor_storage_.data(), stock_factor_storage_.size(), xt::no_ownership(), stock_factor_storage_.shape()

auto view = xt::view(*stock_xarray_, xt::all(), xt::all(), xt::all());
factor(view);

platform:
Windows VS 2019 ERROR
Return:
Error "C2664" void factor (XViewType &) ": unable to change parameter 1 from" view_Type" to "XViewType &"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions