Skip to content

Commit

Permalink
Don't use constexpr.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Jan 12, 2016
1 parent 4491003 commit 6ee71fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions include/pdal/util/Uuid.hpp
Expand Up @@ -54,9 +54,10 @@

#pragma once

#include <cstddef>
#include <string>

#include "pdal_util_export.hpp"

#include "Inserter.hpp"
#include "Extractor.hpp"

Expand Down Expand Up @@ -89,7 +90,7 @@ inline bool operator < (const uuid& u1, const uuid& u2)
return false;
}

class Uuid
PDAL_DLL class Uuid
{
friend inline bool operator < (const Uuid& u1, const Uuid& u2);
public:
Expand Down Expand Up @@ -187,8 +188,12 @@ class Uuid
return true;
}

/**
// Sadly, MS doesn't do constexpr.
static constexpr size_t size()
{ return sizeof(m_data); }
**/
static const int size = sizeof(uuid);

private:
uuid m_data;
Expand Down
8 changes: 4 additions & 4 deletions io/las/LasHeader.cpp
Expand Up @@ -156,19 +156,19 @@ bool LasHeader::valid() const

void LasHeader::get(ILeStream& in, Uuid& uuid)
{
char buf[uuid.size()];
char buf[uuid.size];

in.get(buf, uuid.size());
in.get(buf, uuid.size);
uuid.unpack(buf);
}


void LasHeader::put(OLeStream& out, Uuid uuid)
{
char buf[uuid.size()];
char buf[uuid.size];

uuid.pack(buf);
out.put(buf, uuid.size());
out.put(buf, uuid.size);
}


Expand Down

0 comments on commit 6ee71fa

Please sign in to comment.