[chbot] Stuck on a C++ problem

Geoff sdfgeoff at gmail.com
Fri Jan 18 07:56:06 GMT 2019


It's saying that it doesn't know how to convert this:

{ false,false,false,false,0x00,0x00,"Reset Enable" };

Into one of these:

std::map<long long unsigned int,CommandAttr>:



Which is possibly because you didn't intend to make a hash-map of commands.
If you just want a single command, you could do:

CommandAttr qspi_cmd = { false,false,false,false,0x00,0x00,"Reset Enable" };

If you want to do a map of commands, you'll have to look up the syntax for
initialising std::maps, which I think goes something like:

qspi_cmds[0x66] = {
    {1, { false,false,false,false,0x00,0x00,"Reset Enable" }},
    {2, { false,false,true,false,0x00,0x00,"Reset Disable" }}
}

Geoff

On Fri, Jan 18, 2019 at 1:12 AM follower <follower at rancidbacon.com> wrote:

> On Fri, 18 Jan 2019 at 11:57, Robin Gilks <robin at gilks.org> wrote:
> > source/QSPIAnalyzerCommands.h:3:8: note:   no known conversion for
> > argument 1 from ‘<brace-enclosed initializer list>’ to ‘const
> > CommandAttr&’
>
> I "dabble" in C++ and suspect the above is the key part of the error
> message.
>
> A search for "no known conversion for argument 1 from ‘<brace-enclosed
> initializer list>" results in:
>
>  * <
> https://stackoverflow.com/questions/4118025/brace-enclosed-initializer-list-constructor
> >
>  * <https://en.cppreference.com/w/cpp/language/list_initialization>
>
> Which suggests it may be related to not having the correct C++
> standard specified?
>
> I didn't look at the build files to follow-up on this...
>
> --Philip;
>
> _______________________________________________
> Chchrobotics mailing list Chchrobotics at lists.ourshack.com
> https://lists.ourshack.com/mailman/listinfo/chchrobotics
> Mail Archives: http://lists.ourshack.com/pipermail/chchrobotics/
> Meetings usually 3rd Monday each month. See http://kiwibots.org for
> venue, directions and dates.
> When replying, please edit your Subject line to reflect new subjects.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ourshack.com/pipermail/chchrobotics/attachments/20190118/635fd149/attachment.html>


More information about the Chchrobotics mailing list