Skip to content

Instantly share code, notes, and snippets.

@achilleas-k
Created April 25, 2017 12:59
Show Gist options
  • Save achilleas-k/f94818d379d0edda37d57ffce91eed77 to your computer and use it in GitHub Desktop.
Save achilleas-k/f94818d379d0edda37d57ffce91eed77 to your computer and use it in GitHub Desktop.
#include <nix.hpp>
int main(){
nix::File file = nix::File::open("append_bug.nix", nix::FileMode::Overwrite);
nix::Block bone = file.createBlock("One", "test");
nix::Block btwo = file.createBlock("Two", "test");
nix::DataArray done = bone.createDataArray("DATA", "test", nix::DataType::Double, {1});
nix::DataArray dtwo = btwo.createDataArray("DATA", "test", nix::DataType::Double, {1}); // same name
nix::Group grp = bone.createGroup("grp", "test");
// grp.addDataArray(dtwo); // Uncomment to throw error
grp.dataArrays({dtwo}); // this should throw error but succeeds
std::cout << "dtwo name and id: " << dtwo.name() << ", " << dtwo.id() << std::endl;
std::cout << "appended name and id: " << grp.dataArrays()[0].name() << ", " << grp.dataArrays()[0].id() << std::endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment