<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Binding bracket operator in FlexSim Forum</title>
    <link>https://forums.autodesk.com/t5/flexsim-forum/binding-bracket-operator/m-p/13518159#M29629</link>
    <description>&lt;P&gt;&lt;I&gt;[ FlexSim 17.1.2 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/220/jordan.j.html" nodeid="220"&gt;@jordan.johnson&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Could you help me bind a bracket operator in my custom class? By looking at the macro definition, I figured that something like this should work:&lt;/P&gt;&lt;PRE&gt;void MyObjectArray::bindInterface() const
{
  bindTypedProperty( length, int, &amp;amp;MyObjectArray::GetLength, nullptr );
  // ...
  bindBracketOperator( MyObject, MyObjectArray, int );
}
int MyObjectArray::GetLength() const
{
  return this-&amp;gt;length;
}
MyObject MyObjectArray::operator[]( int index ) const
{
  return this-&amp;gt;objects[index];
}&lt;/PRE&gt;&lt;P&gt;but when I try to use it in FlexSim I get&lt;/P&gt;&lt;PRE&gt;Could not resolve correct operator for [] operation. Left side type is MyObjectArray, right type is int&lt;/PRE&gt;&lt;P&gt;and also the [...] does not show up in code completion. &lt;BR /&gt;Is there a bug or did I misinterpret the arguments to bindBracketOperator?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 18 May 2017 09:50:29 GMT</pubDate>
    <dc:creator>mischa_spelt</dc:creator>
    <dc:date>2017-05-18T09:50:29Z</dc:date>
    <item>
      <title>Binding bracket operator</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/binding-bracket-operator/m-p/13518159#M29629</link>
      <description>&lt;P&gt;&lt;I&gt;[ FlexSim 17.1.2 ]&lt;/I&gt;&lt;/P&gt;&lt;P&gt;Hi &lt;A rel="user" href="https://answers.flexsim.com/users/220/jordan.j.html" nodeid="220"&gt;@jordan.johnson&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Could you help me bind a bracket operator in my custom class? By looking at the macro definition, I figured that something like this should work:&lt;/P&gt;&lt;PRE&gt;void MyObjectArray::bindInterface() const
{
  bindTypedProperty( length, int, &amp;amp;MyObjectArray::GetLength, nullptr );
  // ...
  bindBracketOperator( MyObject, MyObjectArray, int );
}
int MyObjectArray::GetLength() const
{
  return this-&amp;gt;length;
}
MyObject MyObjectArray::operator[]( int index ) const
{
  return this-&amp;gt;objects[index];
}&lt;/PRE&gt;&lt;P&gt;but when I try to use it in FlexSim I get&lt;/P&gt;&lt;PRE&gt;Could not resolve correct operator for [] operation. Left side type is MyObjectArray, right type is int&lt;/PRE&gt;&lt;P&gt;and also the [...] does not show up in code completion. &lt;BR /&gt;Is there a bug or did I misinterpret the arguments to bindBracketOperator?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 09:50:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/binding-bracket-operator/m-p/13518159#M29629</guid>
      <dc:creator>mischa_spelt</dc:creator>
      <dc:date>2017-05-18T09:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Binding bracket operator</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/binding-bracket-operator/m-p/13518160#M29630</link>
      <description>&lt;P&gt;As a side note: I wanted to return by value from operator[], is that allowed as long as MyObject is copyable or does FlexSim always need a reference?&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 09:52:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/binding-bracket-operator/m-p/13518160#M29630</guid>
      <dc:creator>mischa_spelt</dc:creator>
      <dc:date>2017-05-18T09:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Binding bracket operator</title>
      <link>https://forums.autodesk.com/t5/flexsim-forum/binding-bracket-operator/m-p/13518161#M29631</link>
      <description>&lt;P&gt;Never mind, I figured it out. The code is correct, I just forgot to &lt;/P&gt;&lt;PRE&gt;bindClass( MyObject )&lt;/PRE&gt;&lt;P&gt;so probably FlexSim was confused about that.&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 16:58:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/flexsim-forum/binding-bracket-operator/m-p/13518161#M29631</guid>
      <dc:creator>mischa_spelt</dc:creator>
      <dc:date>2017-05-18T16:58:20Z</dc:date>
    </item>
  </channel>
</rss>

